Eliminate internal_styles.cc completely (#804)
authortsteven4 <13596209+tsteven4@users.noreply.github.com>
Wed, 29 Dec 2021 14:48:33 +0000 (07:48 -0700)
committerGitHub <noreply@github.com>
Wed, 29 Dec 2021 14:48:33 +0000 (07:48 -0700)
* Eliminate internal_styles.cc entirely.

* add missing qrc file.

* fix resource compilation with ninja.

* fix potential detach.

* kill empty statement

* update qrc file formatting with QtCreator resource editor.

19 files changed:
CMakeLists.txt
GPSBabel.pro
build_and_test
defs.h
gpsbabel.qrc [new file with mode: 0644]
gui/app.qrc
gui/map.qrc
gui/translations.qrc
internal_styles.cc [deleted file]
mkstyle.sh [deleted file]
style/custom.style
style/gpsdrivetrack.style
style/openoffice.style
style/s_and_t.style
tools/build_extra_tests
vecs.cc
vecs.h
xcsv.cc
xcsv.h

index a13a43d98b221d85f9aedd049e83d3f0a31d2d77..5d5868ac215f8b4aeefd5c5bf20e4eaa17ec1969 100644 (file)
@@ -7,6 +7,8 @@ set(CMAKE_CXX_STANDARD_REQUIRED True)
 
 # Find includes in corresponding build directories
 set(CMAKE_INCLUDE_CURRENT_DIR ON)
+# Handle the Qt rcc code generator automatically
+set(CMAKE_AUTORCC ON)
 
 add_executable(gpsbabel)
 
@@ -24,6 +26,9 @@ if(${QT_VERSION_MAJOR} EQUAL "6")
   list(APPEND QT_LIBRARIES Qt${QT_VERSION_MAJOR}::Core5Compat)
 endif()
 
+# RESOURCES
+set(RESOURCES gpsbabel.qrc)
+
 # MINIMAL_FMTS
 set(MINIMAL_FMTS
   explorist_ini.cc
@@ -318,8 +323,6 @@ endif()
 string(REPLACE .cc .h FILTER_HEADERS "${FILTERS}")
 set(HEADERS ${HEADERS} ${FILTER_HEADERS})
 
-set(SOURCES ${SOURCES} internal_styles.cc)
-
 target_include_directories(gpsbabel PRIVATE zlib)
 
 include(CheckIncludeFile)
index 13c4be77796c2c4bb3dccf6ca5bcecc745410072..a1b29a38b5b167e2ad1348819eb4551ccb2ccb5e 100644 (file)
@@ -55,6 +55,9 @@ GB.setupfile.input = gui/setup.iss.qmake.in
 GB.setupfile.output = gui/setup.iss
 QMAKE_SUBSTITUTES += GB.setupfile
 
+# RESOURCES
+RESOURCES = gpsbabel.qrc
+
 # MINIMAL_FMTS
 MINIMAL_FMTS = \
   explorist_ini.cc \
@@ -303,26 +306,6 @@ versionAtLeast(QT_VERSION, 6.0): HEADERS += src/core/codecdevice.h
 
 HEADERS += $$FILTER_HEADERS
 
-win32-msvc* {
-  # avoid attempts by cmd.exe to execute mkstyle.sh
-  SOURCES += internal_styles.cc
-} else {
-  # It would be nice to do this when make runs instead of qmake, but we will
-  # monitor the style directory to catch new or deleted .style files.
-  STYLE_FILES = $$files($${PWD}/style/*.style)
-  # It's a bit tacky, but this may modify source files when doing an out of source build.
-  # The root of this is that internal_styles.cc is checked in as it can't be built on all platforms,
-  # and we want to make sure it is up to date on commit.
-  styles.commands += $${PWD}/mkstyle.sh > $${PWD}/internal_styles.cc || (rm -f $${PWD}/internal_styles.cc ; exit 1)
-  styles.CONFIG += combine no_clean
-  styles.depends += $${PWD}/mkstyle.sh
-  styles.depends += $${PWD}/style # this catches the creation/deletion of a style file.
-  styles.input = STYLE_FILES
-  styles.output = $${PWD}/internal_styles.cc
-  styles.variable_out = SOURCES
-  QMAKE_EXTRA_COMPILERS += styles
-}
-
 CONFIG(release, debug|release): DEFINES *= NDEBUG
 
 macx|linux|openbsd {
index 2cdb6c1754cb70211e52c649f86493bb4858a525..6d540e5a390deec8c1bf804b01f785be5fc3d9c6 100755 (executable)
@@ -12,12 +12,6 @@ if [ -e /etc/os-release ]; then
        cat /etc/os-release
 fi
 git --no-pager log -n 1
-# the timestamps from a svn co are unpredicatble.
-# this can cause problems if targets are checked into svn.
-# some of our targets are part of the svn repository to allow a
-# minimal set of build tools to be used.
-# touch these targets to make sure they aren't considered out of date.
-touch internal_styles.cc
 # build and test keeping output within the pwd.
 export GBTEMP=$(pwd)/gbtemp
 mkdir -p $GBTEMP
diff --git a/defs.h b/defs.h
index 00018c65e91f2e0286e7cc70db168159380706e9..f08c9d0136e26bb9fa839a83647cd21f6f87c961 100644 (file)
--- a/defs.h
+++ b/defs.h
@@ -1039,12 +1039,6 @@ struct ff_vecs_t {
   void* unused; /* TODO: delete this field */
 };
 
-struct style_vecs_t {
-  const char* name;
-  const char* style_buf;
-};
-extern const QVector<style_vecs_t> style_list;
-
 [[noreturn]] void fatal(QDebug& msginstance);
 [[noreturn]] void fatal(const char*, ...) PRINTFLIKE(1, 2);
 void warning(const char*, ...) PRINTFLIKE(1, 2);
diff --git a/gpsbabel.qrc b/gpsbabel.qrc
new file mode 100644 (file)
index 0000000..35a5fe7
--- /dev/null
@@ -0,0 +1,39 @@
+<RCC>
+    <qresource prefix="/">
+        <file>style/arc.style</file>
+        <file>style/cambridge.style</file>
+        <file>style/csv.style</file>
+        <file>style/cup.style</file>
+        <file>style/custom.style</file>
+        <file>style/dna.style</file>
+        <file>style/flysight.style</file>
+        <file>style/fugawi.style</file>
+        <file>style/garmin301.style</file>
+        <file>style/garmin_g1000.style</file>
+        <file>style/garmin_poi.style</file>
+        <file>style/geonet.style</file>
+        <file>style/gpsdrive.style</file>
+        <file>style/gpsdrivetrack.style</file>
+        <file>style/iblue747.style</file>
+        <file>style/iblue757.style</file>
+        <file>style/igo2008_poi.style</file>
+        <file>style/igoprimo_poi.style</file>
+        <file>style/kompass_tk.style</file>
+        <file>style/kompass_wp.style</file>
+        <file>style/land_air_sea.style</file>
+        <file>style/mainnav.style</file>
+        <file>style/mapconverter.style</file>
+        <file>style/motoactv.style</file>
+        <file>style/mxf.style</file>
+        <file>style/navigonwpt.style</file>
+        <file>style/nima.style</file>
+        <file>style/openoffice.style</file>
+        <file>style/ricoh.style</file>
+        <file>style/s_and_t.style</file>
+        <file>style/saplus.style</file>
+        <file>style/tabsep.style</file>
+        <file>style/tomtom_asc.style</file>
+        <file>style/tomtom_itn_places.style</file>
+        <file>style/tomtom_itn.style</file>
+    </qresource>
+</RCC>
index 9e7b01996ee0a76a8b6e29354585c526567a0352..942fe6313126c9b94b257788579a4a9ddb755836 100644 (file)
@@ -1,20 +1,19 @@
- <!DOCTYPE RCC><RCC version="1.0">
- <qresource>
-     <file>images/00.png</file>
-     <file>images/01.png</file>
-     <file>images/10.png</file>
-     <file>images/11.png</file>
-     <file>images/lights.png</file>
-     <file>images/open.png</file>
-     <file>images/save.png</file>
-     <file>images/runit.png</file>
-     <file>images/exit.png</file>
-     <file>images/help.png</file>
-     <file>images/ok20.png</file>
-     <file>images/ok.png</file>
-     <file>images/cancel.png</file>
-     <file>images/reload.png</file>
-     <file>images/appicon.png</file>
- </qresource>
- </RCC>
-
+<RCC>
+    <qresource prefix="/">
+        <file>images/00.png</file>
+        <file>images/01.png</file>
+        <file>images/10.png</file>
+        <file>images/11.png</file>
+        <file>images/lights.png</file>
+        <file>images/open.png</file>
+        <file>images/save.png</file>
+        <file>images/runit.png</file>
+        <file>images/exit.png</file>
+        <file>images/help.png</file>
+        <file>images/ok20.png</file>
+        <file>images/ok.png</file>
+        <file>images/cancel.png</file>
+        <file>images/reload.png</file>
+        <file>images/appicon.png</file>
+    </qresource>
+</RCC>
index f683ddac53f902ac181d57ec8e84a6b6dfb3d81b..cf2e1fd42292f147cd339b36c46a256285d56313 100644 (file)
@@ -1,5 +1,5 @@
- <!DOCTYPE RCC><RCC version="1.0">
<qresource>
-     <file>gmapbase.html</file>
- </qresource>
- </RCC>
+<RCC>
   <qresource prefix="/">
+        <file>gmapbase.html</file>
   </qresource>
+</RCC>
index 582eeca085f325aeca9008ae4a07f4189055b414..aa7e17c6b34546d02081539133b09a2a4a67eeab 100644 (file)
@@ -1,16 +1,16 @@
- <!DOCTYPE RCC><RCC version="1.0">
<qresource>
-     <file alias="translations/gpsbabel_de.qm">coretool/gpsbabel_de.qm</file>
-     <file alias="translations/gpsbabel_es.qm">coretool/gpsbabel_es.qm</file>
-     <file alias="translations/gpsbabel_fr.qm">coretool/gpsbabel_fr.qm</file>
-     <file alias="translations/gpsbabel_hu.qm">coretool/gpsbabel_hu.qm</file>
-     <file alias="translations/gpsbabel_it.qm">coretool/gpsbabel_it.qm</file>
-     <file alias="translations/gpsbabel_ru.qm">coretool/gpsbabel_ru.qm</file>
-     <file alias="translations/gpsbabelfe_de.qm">gpsbabelfe_de.qm</file>
-     <file alias="translations/gpsbabelfe_es.qm">gpsbabelfe_es.qm</file>
-     <file alias="translations/gpsbabelfe_fr.qm">gpsbabelfe_fr.qm</file>
-     <file alias="translations/gpsbabelfe_hu.qm">gpsbabelfe_hu.qm</file>
-     <file alias="translations/gpsbabelfe_it.qm">gpsbabelfe_it.qm</file>
-     <file alias="translations/gpsbabelfe_ru.qm">gpsbabelfe_ru.qm</file>
- </qresource>
- </RCC>
+<RCC>
   <qresource prefix="/">
+        <file alias="translations/gpsbabel_de.qm">coretool/gpsbabel_de.qm</file>
+        <file alias="translations/gpsbabel_es.qm">coretool/gpsbabel_es.qm</file>
+        <file alias="translations/gpsbabel_fr.qm">coretool/gpsbabel_fr.qm</file>
+        <file alias="translations/gpsbabel_hu.qm">coretool/gpsbabel_hu.qm</file>
+        <file alias="translations/gpsbabel_it.qm">coretool/gpsbabel_it.qm</file>
+        <file alias="translations/gpsbabel_ru.qm">coretool/gpsbabel_ru.qm</file>
+        <file alias="translations/gpsbabelfe_de.qm">gpsbabelfe_de.qm</file>
+        <file alias="translations/gpsbabelfe_es.qm">gpsbabelfe_es.qm</file>
+        <file alias="translations/gpsbabelfe_fr.qm">gpsbabelfe_fr.qm</file>
+        <file alias="translations/gpsbabelfe_hu.qm">gpsbabelfe_hu.qm</file>
+        <file alias="translations/gpsbabelfe_it.qm">gpsbabelfe_it.qm</file>
+        <file alias="translations/gpsbabelfe_ru.qm">gpsbabelfe_ru.qm</file>
   </qresource>
+</RCC>
diff --git a/internal_styles.cc b/internal_styles.cc
deleted file mode 100644 (file)
index 1929d07..0000000
+++ /dev/null
@@ -1,1355 +0,0 @@
-/* This file is machine-generated from the contents of style/ */
-/* by mkstyle.sh.   Editing it by hand is an exceedingly bad idea. */
-
-#include <QVector>
-#include "defs.h"
-#if CSVFMTS_ENABLED
-static char arc[] =
-  "# gpsbabel XCSV style file\n"
-  "#\n"
-  "# Format: GPSBabel arc filter format\n"
-  "# Author: Ron Parker\n"
-  "#   Date: 17 July 2003\n"
-  "#\n"
-
-  "DESCRIPTION         GPSBabel arc filter file\n"
-  "EXTENSION           txt\n"
-
-  "#\n"
-  "# FILE LAYOUT DEFINITIIONS:\n"
-  "#\n"
-  "FIELD_DELIMITER             TAB\n"
-  "RECORD_DELIMITER    NEWLINE\n"
-
-  "#\n"
-  "# INDIVIDUAL DATA FIELDS, IN ORDER OF APPEARANCE:\n"
-  "#\n"
-  "IFIELD      LAT_HUMAN_READABLE, \"\", \"%08.5f\"\n"
-  "IFIELD      LON_HUMAN_READABLE, \"\", \"%08.5f\"\n"
-
-  "OFIELD      LAT_DECIMAL, \"\", \"%08.5f\"\n"
-  "OFIELD      LON_DECIMAL, \"\", \"%08.5f\"\n"
-  ;
-static char cambridge[] =
-  "DESCRIPTION     Cambridge/Winpilot glider software\n"
-  "SHORTLEN        8\n"
-  "EXTENSION dat\n"
-  "#\n"
-  "#\n"
-  "# FILE LAYOUT DEFINITIIONS:\n"
-  "#\n"
-  "FIELD_DELIMITER         COMMA\n"
-  "RECORD_DELIMITER        NEWLINE\n"
-  "BADCHARS                COMMA\n"
-
-  "IFIELD INDEX,\"1\",\"%d\"\n"
-  "IFIELD LAT_HUMAN_READABLE,\"\",\"%d:%06.3f%c\"\n"
-  "IFIELD LON_HUMAN_READABLE,\"\",\"%03d:%06.3f%c\"\n"
-  "IFIELD ALT_METERS,\"\",\"%3.0fM\"\n"
-  "IFIELD CONSTANT,\"\",\"T\"\n"
-  "IFIELD SHORTNAME,\"\",\"%s\"\n"
-  "IFIELD DESCRIPTION,\"\",\"%s\"\n"
-  ;
-static char csv[] =
-  "# gpsbabel XCSV style file\n"
-  "#\n"
-  "# Format: DeLorme SA 9.0 CSV\n"
-  "# Author: Alex Mottram\n"
-  "#   Date: 12/09/2002\n"
-  "#\n"
-  "#\n"
-  "DESCRIPTION Comma separated values\n"
-  "SHORTLEN    8\n"
-  "#\n"
-  "#\n"
-  "# FILE LAYOUT DEFINITIIONS:\n"
-  "#\n"
-  "FIELD_DELIMITER             COMMASPACE\n"
-  "RECORD_DELIMITER    NEWLINE\n"
-  "BADCHARS            COMMA\n"
-
-  "#\n"
-  "# INDIVIDUAL DATA FIELDS, IN ORDER OF APPEARANCE:\n"
-  "#\n"
-  "IFIELD      LAT_HUMAN_READABLE, \"\", \"%08.5f\"\n"
-  "IFIELD      LON_HUMAN_READABLE, \"\", \"%08.5f\"\n"
-  "IFIELD      DESCRIPTION, \"\", \"%s\"\n"
-
-  "OFIELD      LAT_DECIMAL, \"\", \"%08.5f\"\n"
-  "OFIELD      LON_DECIMAL, \"\", \"%08.5f\"\n"
-  "OFIELD      DESCRIPTION, \"\", \"%s\"\n"
-  ;
-static char cup[] =
-  "#\n"
-  "# (c) 2006, Robert Lipe, based on  sample files by Krzysztof Wojtas\n"
-  "# Reference info: http://www.seeyou.ws/thankyou.php?fname=cup_format.pdf\n"
-  "# Reference info: http://download.naviter.com/docs/cup_format.pdf\n"
-  "# Reference info: http://www.keepitsoaring.com/LKSC/Downloads/cup_format.pdf\n"
-  "#\n"
-
-  "DESCRIPTION      See You flight analysis data\n"
-  "SHORTLEN  8\n"
-  "EXTENSION cup\n"
-  "#\n"
-  "#\n"
-  "# FILE LAYOUT DEFINITIIONS:\n"
-  "#\n"
-  "FIELD_DELIMITER         COMMA\n"
-  "RECORD_DELIMITER        NEWLINE\n"
-  "BADCHARS                ,\"\n"
-  "PROLOGUE name,code,country,lat,lon,elev,style,rwdir,rwlen,freq,desc\n"
-  "EPILOGUE -----Related Tasks-----\n"
-
-
-  "IFIELD IGNORE,\"\", \"\"%s\"\"\n"
-  "IFIELD SHORTNAME,\"\", \"%s\"\n"
-  "IFIELD CONSTANT,\"\", \"\"\n"
-  "IFIELD LAT_DDMMDIR, \"%f\", \"%08.3f\", \"absolute\"\n"
-  "IFIELD LON_DDMMDIR, \"%f\", \"%09.3f\", \"absolute\"\n"
-  "IFIELD ALT_METERS,\"\", \"%dm\"\n"
-  "IFIELD CONSTANT,\"\", \"1\"\n"
-  "IFIELD CONSTANT,\"\", \"\"\n"
-  "IFIELD CONSTANT,\"\", \"\"\n"
-  "IFIELD CONSTANT,\"\", \"\"\n"
-  "IFIELD DESCRIPTION,\"\", \"\"%s\"\"\n"
-
-  "OFIELD SHORTNAME,\"\", \"\"%s\"\"\n"
-  "OFIELD SHORTNAME,\"\", \"%s\"\n"
-  "OFIELD CONSTANT,\"\", \"\"\n"
-  "OFIELD LAT_DDMMDIR, \"\", \"%08.3f%c\"\n"
-  "OFIELD LON_DDMMDIR, \"\", \"%09.3f%c\"\n"
-  "OFIELD ALT_METERS,\"\", \"%3.1fm\"\n"
-  "OFIELD CONSTANT,\"\", \"1\"\n"
-  "OFIELD CONSTANT,\"\", \"\"\n"
-  "OFIELD CONSTANT,\"\", \"\"\n"
-  "OFIELD CONSTANT,\"\", \"\"\n"
-  "OFIELD DESCRIPTION,\"\", \"\"%s\"\"\n"
-
-
-  ;
-static char custom[] =
-  "# gpsbabel XCSV style file\n"
-  "#\n"
-  "# Format: Custom \"Everything\" Style\n"
-  "# Author: Alex Mottram\n"
-  "#   Date: 11/24/2002\n"
-  "#\n"
-  "#\n"
-
-  "DESCRIPTION         Custom \"Everything\" Style\n"
-
-  "# FILE LAYOUT DEFINITIIONS:\n"
-  "#\n"
-  "FIELD_DELIMITER             COMMA\n"
-  "RECORD_DELIMITER    NEWLINE\n"
-  "BADCHARS            COMMA\n"
-  "FORMAT_TYPE         INTERNAL\n"
-
-  "#\n"
-  "# HEADER STUFF:\n"
-  "#\n"
-  "PROLOGUE    Prologue Line 1 __FILE__\n"
-  "PROLOGUE    Prologue Line 2\n"
-
-  "#\n"
-  "# INDIVIDUAL DATA FIELDS:\n"
-  "#\n"
-  "IFIELD      CONSTANT, \"CONSTANT\", \"%s\"\n"
-  "IFIELD      INDEX, \"\", \"%d\"\n"
-  "IFIELD      LAT_DECIMAL, \"\", \"%f\"\n"
-  "IFIELD      LAT_DIR, \"\", \"%c\"\n"
-  "IFIELD      LON_DECIMAL, \"\", \"%f\"\n"
-  "IFIELD      LON_DIR, \"\", \"%c\"\n"
-  "IFIELD      ICON_DESCR, \"\", \"%s\"\n"
-  "IFIELD      SHORTNAME, \"\", \"%s\"\n"
-  "IFIELD      DESCRIPTION, \"\", \"%s\"\n"
-  "IFIELD      NOTES, \"\", \"%s\"\n"
-  "IFIELD      URL, \"\", \"%s\"               \n"
-  "IFIELD      URL_LINK_TEXT, \"\", \"%s\"\n"
-  "IFIELD      ALT_METERS, \"\", \"%fM\"\n"
-  "IFIELD      ALT_FEET, \"\", \"%fF\"\n"
-  "IFIELD      LAT_DECIMALDIR, \"\", \"%f/%c\"\n"
-  "IFIELD      LON_DECIMALDIR, \"\", \"%f/%c\"\n"
-  "IFIELD      LAT_DIRDECIMAL, \"\", \"%c/%f\"\n"
-  "IFIELD      LON_DIRDECIMAL, \"\", \"%c/%f\"\n"
-  "IFIELD      LAT_INT32DEG, \"\", \"%ld\"\n"
-  "IFIELD      LON_INT32DEG, \"\", \"%ld\"\n"
-  "IFIELD      TIMET_TIME, \"\", \"%lld\"\n"
-  "IFIELD      EXCEL_TIME, \"\", \"%f\"\n"
-
-  "# EPILOGUE:\n"
-  "EPILOGUE    Epilogue Line 1\n"
-  "EPILOGUE    Epilogue Line 2\n"
-  ;
-static char dna[] =
-  "# gpsbabel XCSV style file\n"
-  "#\n"
-  "# Format: DNA Marker Format\n"
-  "# Author: Alex Mottram\n"
-  "#   Date: 12/09/2002\n"
-  "#\n"
-  "#\n"
-  "# As defined in dna.c\n"
-  "#\n"
-  "#\n"
-
-  "DESCRIPTION                 Navitrak DNA marker format\n"
-  "EXTENSION           dna\n"
-
-  "# FILE LAYOUT DEFINITIIONS:\n"
-  "#\n"
-  "FIELD_DELIMITER             COMMA\n"
-  "RECORD_DELIMITER    NEWLINE\n"
-  "BADCHARS            COMMA\n"
-
-  "#\n"
-  "# INDIVIDUAL DATA FIELDS, IN ORDER OF APPEARANCE:\n"
-  "#\n"
-  "IFIELD      INDEX, \"\", \"%d\"\n"
-  "IFIELD      LAT_DECIMAL, \"\", \"%08.5f\"\n"
-  "IFIELD      LON_DECIMAL, \"\", \"%08.5f\"\n"
-  "IFIELD      DESCRIPTION, \"\", \"%s\"\n"
-
-  ;
-static char flysight[] =
-  "# Format:   FlySight\n"
-  "# Author:   LukeH\n"
-  "# Date:             10/10/10\n"
-
-  "DESCRIPTION         FlySight GPS File\n"
-  "EXTENSION           csv\n"
-
-  "# FILE LAYOUT DEFINITIIONS:\n"
-  "FIELD_DELIMITER COMMA\n"
-  "RECORD_DELIMITER NEWLINE\n"
-  "BADCHARS ,\"\n"
-
-  "PROLOGUE time lat lon hMSL velN velE velD hAcc vAcc sAcc gpsFix numSV\n"
-  "PROLOGUE\n"
-
-  "# INDIVIDUAL DATA FIELDS, IN ORDER OF APPEARANCE:\n"
-  "IFIELD ISO_TIME,    \"\",   \"%s\"  # Date & time\n"
-  "IFIELD LAT_DECIMAL, \"\",   \"%f\"  # Latitude\n"
-  "IFIELD LON_DECIMAL, \"\",   \"%f\"  # Longitude\n"
-  "IFIELD ALT_METERS,  \"\",   \"%.0f\"        # Altitude above MSL (m)\n"
-  "IFIELD IGNORE,              \"\",   \"%s\"  # Velocity north (m/s)\n"
-  "IFIELD IGNORE,              \"\",   \"%s\"  # Velocity east (m/s)\n"
-  "IFIELD IGNORE,              \"\",   \"%s\"  # Velocity down (m/s)\n"
-  "IFIELD IGNORE,              \"\",   \"%s\"  # Horizontal accuracy (m)\n"
-  "IFIELD IGNORE,              \"\",   \"%s\"  # Vertical accuracy (m)\n"
-  "IFIELD IGNORE,              \"\",   \"%s\"  # Speed accuracy (m/s)\n"
-  "IFIELD GPS_FIX,             \"\",   \"%s\"  # GPS fix type\n"
-  "IFIELD GPS_SAT,             \"\",   \"%d\"  # Number of satellites used in fix\n"
-  ;
-static char fugawi[] =
-  "# fugawi XCSV style file\n"
-  "#\n"
-  "# Format: Fugawi\n"
-  "# Author: Robert Lipe, Patrick Ohly\n"
-  "#   Date: 07/24/2005\n"
-  "#\n"
-  "#\n"
-
-  "DESCRIPTION         Fugawi\n"
-  "EXTENSION           txt\n"
-  "SHORTLEN            10\n"
-
-  "#\n"
-  "# FILE LAYOUT DEFINITIIONS:\n"
-  "#\n"
-  "FIELD_DELIMITER             COMMA\n"
-  "RECORD_DELIMITER    NEWLINE\n"
-  "BADCHARS            COMMA\n"
-
-  "PROLOGUE \\# Latitude, Longitude and UTM coordinates are in WGS84 datum\n"
-  "PROLOGUE \\#\n"
-  "PROLOGUE \\# Every set of data contains the following:\n"
-  "PROLOGUE \\#\n"
-  "PROLOGUE \\# Waypoint name\n"
-  "PROLOGUE \\# Waypoint comment\n"
-  "PROLOGUE \\# Waypoint description\n"
-  "PROLOGUE \\# Latitude in Degree and decimals (southern hemisphere has neg. degrees)\n"
-  "PROLOGUE \\# Longitude in degree and decimals (neg. numbers: west of Greenwich)\n"
-  "PROLOGUE \\# Height in meters [optional when importing, always present when exporting: Date (GMT) as ISO YYYYMMDD, Time of the day relative to the date as HHMMSS\n"
-
-  "#\n"
-  "# INDIVIDUAL DATA FIELDS, IN ORDER OF APPEARANCE:\n"
-  "#\n"
-  "IFIELD      SHORTNAME, \"\", \"%s\"\n"
-  "IFIELD      DESCRIPTION, \"\", \"%s\"\n"
-  "IFIELD      NOTES, \"\", \"%s\"\n"
-  "IFIELD      LAT_DECIMAL, \"\", \"%-.7f\"\n"
-  "IFIELD      LON_DECIMAL, \"\", \"%-.7f\"\n"
-  "IFIELD      ALT_METERS, \"\", \"%-7.1f\"\n"
-  "IFIELD  GMT_TIME, \"\", \"%Y%m%d\"\n"
-  "IFIELD  HMSG_TIME, \"\", \"%02d%02d%02d\"\n"
-  ;
-static char garmin301[] =
-  "# gpsbabel XCSV style file\n"
-  "#\n"
-  "# Format: Garmin 301 Position + Heartrate data\n"
-  "# Author: Jeff Kalikstein\n"
-  "#   Date: 08/29/2005\n"
-  "#\n"
-
-  "DESCRIPTION         Garmin 301 Custom position and heartrate\n"
-
-  "# FILE LAYOUT DEFINITIIONS:\n"
-  "#\n"
-  "FIELD_DELIMITER             COMMA\n"
-  "RECORD_DELIMITER    NEWLINE\n"
-  "BADCHARS            COMMA\n"
-  "#FORMAT_TYPE                INTERNAL\n"
-
-  "#\n"
-  "# HEADER STUFF:\n"
-  "#\n"
-  "PROLOGUE    Garmin 301 data __FILE__\n"
-  "PROLOGUE    Timestamp,Latitude, Longitude, Altitude(ft), heart rate\n"
-  "#\n"
-  "# INDIVIDUAL DATA FIELDS:\n"
-  "#\n"
-  "IFIELD      TIMET_TIME,\"\",\"%lld\"\n"
-  "IFIELD      LAT_DECIMAL, \"\", \"%f\"\n"
-  "IFIELD      LON_DECIMAL, \"\", \"%f\"\n"
-  "IFIELD      ALT_FEET, \"\", \"%fF\"\n"
-  "IFIELD  HEART_RATE,\"\",\" %d\"     # beats per minute\n"
-
-
-  "# EPILOGUE:\n"
-  "#EPILOGUE   Epilogue Line 1\n"
-  "#EPILOGUE   Epilogue Line 2\n"
-  ;
-static char garmin_g1000[] =
-  "# gpsbabel XCSV style file\n"
-  "#\n"
-  "# Format: Garmin G1000 Datalog Format (Cessna 182T and others)\n"
-  "# Author: Matt Johnson\n"
-  "# Date: 04/09/2014\n"
-  "#\n"
-
-  "DESCRIPTION         Garmin G1000 datalog input filter file\n"
-  "EXTENSION           csv\n"
-
-  "# FILE LAYOUT DEFINITIIONS:\n"
-  "#\n"
-  "FIELD_DELIMITER     COMMA\n"
-  "RECORD_DELIMITER    NEWLINE\n"
-  "BADCHARS            COMMA\n"
-
-  "# INTERNAL CONSTANTS\n"
-  "#\n"
-  "DATATYPE TRACK\n"
-
-  "#\n"
-  "# HEADER\n"
-  "#\n"
-  "PROLOGUE airframe_info, log_version=\"1.00\", airframe_name=\"Cessna 182T\", unit_software_part_number=\"\", unit_software_version=\"12.03\", system_software_part_number=\"\", system_id=\"\", mode=NORMAL,\n"
-  "PROLOGUE yyyy-mm-dd, hh:mm:ss,   hh:mm,  ident,      degrees,      degrees, ft Baro,  inch,  ft msl, deg C,     kt,     kt,     fpm,    deg,    deg,      G,      G,   deg,   deg, volts, volts,  amps,  amps,   gals,   gals,      gph,   deg F,     psi,     Hg,    rpm,   deg F,   deg F,   deg F,   deg F,   deg F,   deg F,   deg F,   deg F,   deg F,   deg F,   deg F,   deg F,  ft wgs,  kt, enum,    deg,    MHz,    MHz,     MHz,     MHz,    fsd,    fsd,     kt,   deg,     nm,    deg,    deg,   bool,  enum,   enum,   deg,   deg,   fpm,   enum,   mt,    mt,     mt,    mt,     mt\n"
-  "PROLOGUE Lcl Date, Lcl Time, UTCOfst, AtvWpt,     Latitude,    Longitude,    AltB, BaroA,  AltMSL,   OAT,    IAS, GndSpd,    VSpd,  Pitch,   Roll,  LatAc, NormAc,   HDG,   TRK, volt1, volt2,  amp1,  amp2,  FQtyL,  FQtyR, E1 FFlow, E1 OilT, E1 OilP, E1 MAP, E1 RPM, E1 CHT1, E1 CHT2, E1 CHT3, E1 CHT4, E1 CHT5, E1 CHT6, E1 EGT1, E1 EGT2, E1 EGT3, E1 EGT4, E1 EGT5, E1 EGT6,  AltGPS, TAS, HSIS,    CRS,   NAV1,   NAV2,    COM1,    COM2,   HCDI,   VCDI, WndSpd, WndDr, WptDst, WptBrg, MagVar, AfcsOn, RollM, PitchM, RollC, PichC, VSpdG, GPSfix,  HAL,   VAL, HPLwas, HPLfd, VPLwas\n"
-
-  "#\n"
-  "# INDIVIDUAL DATA FIELDS:\n"
-  "#\n"
-  "IFIELD GMT_TIME,\"\",\"%Y-%m-%d\"           #Lcl Date,\n"
-  "IFIELD HMSG_TIME,\"\",\"%d:%d:%d %s\"       #Lcl Time,\n"
-  "IFIELD IGNORE,\"\",\"%s\"                           #UTCOfst,\n"
-  "IFIELD IGNORE,\"\",\"%s\"                           #AtvWpt,\n"
-  "IFIELD LAT_DECIMAL, \"\", \"%f\"            #Latitude,\n"
-  "IFIELD LON_DECIMAL, \"\", \"%f\"            #Longitude,\n"
-  "IFIELD ALT_FEET,\"\",\"%.0f\"                       #AltB,\n"
-  "IFIELD IGNORE,\"\",\"%s\"                           #BaroA,\n"
-  "IFIELD IGNORE,\"\",\"%s\"                           #AltMSL,\n"
-  "IFIELD IGNORE,\"\",\"%s\"                           #OAT,\n"
-  "IFIELD IGNORE,\"\",\"%s\"                           #IAS,\n"
-  "IFIELD IGNORE,\"\",\"%s\"                           #GndSpd,\n"
-  "IFIELD IGNORE,\"\",\"%s\"                           #VSpd,\n"
-  "IFIELD IGNORE,\"\",\"%s\"                           #Pitch,\n"
-  "IFIELD IGNORE,\"\",\"%s\"                           #Roll,\n"
-  "IFIELD IGNORE,\"\",\"%s\"                           #LatAc,\n"
-  "IFIELD IGNORE,\"\",\"%s\"                           #NormAc,\n"
-  "IFIELD IGNORE,\"\",\"%s\"                           #HDG,\n"
-  "IFIELD IGNORE,\"\",\"%s\"                           #TRK,\n"
-  "IFIELD IGNORE,\"\",\"%s\"                           #volt1,\n"
-  "IFIELD IGNORE,\"\",\"%s\"                           #volt2,\n"
-  "IFIELD IGNORE,\"\",\"%s\"                           #amp1,\n"
-  "IFIELD IGNORE,\"\",\"%s\"                           #amp2,\n"
-  "IFIELD IGNORE,\"\",\"%s\"                           #FQtyL,\n"
-  "IFIELD IGNORE,\"\",\"%s\"                           #FQtyR,\n"
-  "IFIELD IGNORE,\"\",\"%s\"                           #E1 FFlow,\n"
-  "IFIELD IGNORE,\"\",\"%s\"                           #E1 OilT,\n"
-  "IFIELD IGNORE,\"\",\"%s\"                           #E1 OilP,\n"
-  "IFIELD IGNORE,\"\",\"%s\"                           #E1 MAP,\n"
-  "IFIELD IGNORE,\"\",\"%s\"                           #E1 RPM,\n"
-  "IFIELD IGNORE,\"\",\"%s\"                           #E1 CHT1,\n"
-  "IFIELD IGNORE,\"\",\"%s\"                           #E1 CHT2,\n"
-  "IFIELD IGNORE,\"\",\"%s\"                           #E1 CHT3,\n"
-  "IFIELD IGNORE,\"\",\"%s\"                           #E1 CHT4,\n"
-  "IFIELD IGNORE,\"\",\"%s\"                           #E1 CHT5,\n"
-  "IFIELD IGNORE,\"\",\"%s\"                           #E1 CHT6,\n"
-  "IFIELD IGNORE,\"\",\"%s\"                           #E1 EGT1,\n"
-  "IFIELD IGNORE,\"\",\"%s\"                           #E1 EGT2,\n"
-  "IFIELD IGNORE,\"\",\"%s\"                           #E1 EGT3,\n"
-  "IFIELD IGNORE,\"\",\"%s\"                           #E1 EGT4,\n"
-  "IFIELD IGNORE,\"\",\"%s\"                           #E1 EGT5,\n"
-  "IFIELD IGNORE,\"\",\"%s\"                           #E1 EGT6,\n"
-  "IFIELD IGNORE,\"\",\"%s\"                           #E1 TIT1,\n"
-  "IFIELD IGNORE,\"\",\"%s\"                           #AltGPS,\n"
-  "IFIELD IGNORE,\"\",\"%s\"                           #TAS,\n"
-  "IFIELD IGNORE,\"\",\"%s\"                           #HSIS,\n"
-  "IFIELD IGNORE,\"\",\"%s\"                           #CRS,\n"
-  "IFIELD IGNORE,\"\",\"%s\"                           #NAV1,\n"
-  "IFIELD IGNORE,\"\",\"%s\"                           #NAV2,\n"
-  "IFIELD IGNORE,\"\",\"%s\"                           #COM1,\n"
-  "IFIELD IGNORE,\"\",\"%s\"                           #COM2,\n"
-  "IFIELD IGNORE,\"\",\"%s\"                           #HCDI,\n"
-  "IFIELD IGNORE,\"\",\"%s\"                           #VCDI,\n"
-  "IFIELD IGNORE,\"\",\"%s\"                           #WndSpd,\n"
-  "IFIELD IGNORE,\"\",\"%s\"                           #WndDr,\n"
-  "IFIELD IGNORE,\"\",\"%s\"                           #WptDst,\n"
-  "IFIELD IGNORE,\"\",\"%s\"                           #WptBrg,\n"
-  "IFIELD IGNORE,\"\",\"%s\"                           #MagVar,\n"
-  "IFIELD IGNORE,\"\",\"%s\"                           #AfcsOn,\n"
-  "IFIELD IGNORE,\"\",\"%s\"                           #RollM,\n"
-  "IFIELD IGNORE,\"\",\"%s\"                           #PitchM,\n"
-  "IFIELD IGNORE,\"\",\"%s\"                           #RollC,\n"
-  "IFIELD IGNORE,\"\",\"%s\"                           #PichC,\n"
-  "IFIELD IGNORE,\"\",\"%s\"                           #VSpdG,\n"
-  "IFIELD IGNORE,\"\",\"%s\"                           #GPSfix,\n"
-  "IFIELD IGNORE,\"\",\"%s\"                           #HAL,\n"
-  "IFIELD IGNORE,\"\",\"%s\"                           #VAL,\n"
-  "IFIELD IGNORE,\"\",\"%s\"                           #HPLwas,\n"
-  "IFIELD IGNORE,\"\",\"%s\"                           #HPLfd,\n"
-  "IFIELD IGNORE,\"\",\"%s\"                           #VPLwas\n"
-  ;
-static char garmin_poi[] =
-  "# gpsbabel XCSV style file\n"
-  "#\n"
-  "# Format: Garmin POI\n"
-  "# Author: Robert Lipe\n"
-  "# Date: 10/07/2005\n"
-  "# Reference: http://forums.groundspeak.com/GC/index.php?showtopic=110641&st=0&#entry1752204\n"
-  "#\n"
-  "DESCRIPTION Garmin POI database\n"
-  "#\n"
-  "#\n"
-  "# FILE LAYOUT DEFINITIIONS:\n"
-  "#\n"
-  "FIELD_DELIMITER COMMA\n"
-  "RECORD_DELIMITER NEWLINE\n"
-  "BADCHARS COMMA\n"
-  "SHORTLEN 24\n"
-  "# PROLOGUE Longitude,Latitude,Name, comment\n"
-
-  "#\n"
-  "# INDIVIDUAL DATA FIELDS, IN ORDER OF APPEARANCE:\n"
-  "#\n"
-  "IFIELD LON_HUMAN_READABLE, \"\", \"%08.5f\"\n"
-  "IFIELD LAT_HUMAN_READABLE, \"\", \"%08.5f\"\n"
-  "IFIELD SHORTNAME, \"\", \"%s\"\n"
-  "IFIELD DESCRIPTION, \"\", \"%s\"\n"
-
-  "OFIELD LON_DECIMAL, \"\", \"%08.5f\"\n"
-  "OFIELD LAT_DECIMAL, \"\", \"%08.5f\"\n"
-  "OFIELD SHORTNAME, \"\", \"%-.24s\"\n"
-  "OFIELD GEOCACHE_TYPE, \"\", \" %-.4s\", \"no_delim_before,optional\"\n"
-  "OFIELD GEOCACHE_CONTAINER, \"\", \"/%-.4s \", \"no_delim_before,optional\"\n"
-  "OFIELD GEOCACHE_DIFF, \"\", \"(%3.1f\", \"no_delim_before,optional\"\n"
-  "OFIELD GEOCACHE_TERR, \"\", \"/%3.1f)\", \"no_delim_before,optional\"\n"
-  "OFIELD DESCRIPTION, \"\", \"%-.50s\"\n"
-  ;
-static char geonet[] =
-  "# gpsbabel XCSV style file\n"
-  "#\n"
-  "# Format: GEOnet Names Server (GNS) (http://earth-info.nga.mil/gns/html/cntry_files.html)\n"
-  "# Author: Olaf Klein\n"
-  "#   Date: 08/20/2002\n"
-  "#\n"
-
-  "DESCRIPTION         GEOnet Names Server (GNS)\n"
-  "EXTENSION           txt\n"
-
-  "#\n"
-  "# FILE LAYOUT DEFINITIIONS:\n"
-  "#\n"
-
-  "FIELD_DELIMITER             TAB\n"
-  "RECORD_DELIMITER    CRNEWLINE\n"
-  "BADCHARS            TAB\n"
-  "ENCODING            UTF-8\n"
-
-  "PROLOGUE            RC      UFI     UNI     LAT     LONG    DMS_LAT DMS_LONG        UTM     JOG     FC      DSG     PC      CC1     ADM1    ADM2    DIM     CC2     NT      LC      SHORT_FORM      GENERIC SORT_NAME       FULL_NAME       FULL_NAME_ND    MODIFY_DATE\n"
-
-  "#\n"
-  "# INDIVIDUAL DATA FIELDS, IN ORDER OF APPEARANCE:\n"
-  "#\n"
-  "IFIELD      IGNORE, \"\", \"%s\"            # RC            ( http://earth-info.nga.mil/gns/html/gis_contryfiles.html )\n"
-  "IFIELD      IGNORE, \"\", \"%s\"            # UFI\n"
-  "IFIELD      IGNORE, \"\", \"%s\"            # UNI\n"
-  "IFIELD      LAT_DECIMAL, \"\", \"%03.7f\"   # LAT\n"
-  "IFIELD      LON_DECIMAL, \"\", \"%03.7f\"   # LONG\n"
-  "IFIELD      IGNORE, \"\", \"%s\"            # DMS_LAT\n"
-  "IFIELD      IGNORE, \"\", \"%s\"            # DMS_LONG\n"
-  "IFIELD      IGNORE, \"\", \"%s\"            # UTM\n"
-  "IFIELD      IGNORE, \"\", \"%s\"            # JOG\n"
-  "IFIELD      IGNORE, \"\", \"%s\"            # FC\n"
-  "IFIELD      IGNORE, \"\", \"%s\"            # DSG\n"
-  "IFIELD      IGNORE, \"\", \"%s\"            # PC\n"
-  "IFIELD      IGNORE, \"\", \"%s\"            # CC1\n"
-  "IFIELD      IGNORE, \"\", \"%s\"            # ADM1\n"
-  "IFIELD      IGNORE, \"\", \"%s\"            # ADM2\n"
-  "IFIELD      IGNORE, \"\", \"%s\"            # DIM\n"
-  "IFIELD      IGNORE, \"\", \"%s\"            # CC2\n"
-  "IFIELD      IGNORE, \"\", \"%s\"            # NT\n"
-  "IFIELD      IGNORE, \"\", \"%s\"            # LC\n"
-  "IFIELD      IGNORE, \"\", \"%s\"            # SHORT_FORM\n"
-  "IFIELD      IGNORE, \"\", \"%s\"            # GENERIC\n"
-  "IFIELD      SHORTNAME, \"\", \"%s\"         # SHORT_NAME\n"
-  "IFIELD      DESCRIPTION, \"\", \"%s\"               # FULL_NAME\n"
-  "IFIELD      IGNORE, \"\", \"%s\"            # FULL_NAME_ND\n"
-  "IFIELD      IGNORE, \"\", \"%s\"            # MOD_DATE\n"
-  ;
-static char gpsdrive[] =
-  "# gpsbabel XCSV style file\n"
-  "#\n"
-  "# Format: GPSDrive\n"
-  "# Author: Alex Mottram\n"
-  "#   Date: 12/11/2002\n"
-  "#\n"
-  "#\n"
-  "#\n"
-
-  "DESCRIPTION         GpsDrive Format\n"
-
-  "# FILE LAYOUT DEFINITIIONS:\n"
-  "#\n"
-  "FIELD_DELIMITER             WHITESPACE\n"
-  "RECORD_DELIMITER    NEWLINE\n"
-  "BADCHARS            ,'\"\n"
-
-  "SHORTLEN            20\n"
-  "SHORTWHITE              0\n"
-
-  "#\n"
-  "# INDIVIDUAL DATA FIELDS, IN ORDER OF APPEARANCE:\n"
-
-  "IFIELD      SHORTNAME, \"\", \"%s\"\n"
-  "IFIELD      LAT_DECIMAL, \"\", \"%08.5f\"\n"
-  "IFIELD      LON_DECIMAL, \"\", \"%08.5f\"\n"
-  "IFIELD      ICON_DESCR, \"\", \"%s\"\n"
-
-  "OFIELD      ANYNAME, \"\", \"%s\"\n"
-  "OFIELD      LAT_DECIMAL, \"\", \"%08.5f\"\n"
-  "OFIELD      LON_DECIMAL, \"\", \"%08.5f\"\n"
-  "OFIELD      ICON_DESCR, \"\", \"%s\"\n"
-  ;
-static char gpsdrivetrack[] =
-  "# gpsbabel XCSV style file\n"
-  "#\n"
-  "# Format: GPSDriveTrack\n"
-  "# Author: Tobias Minich\n"
-  "#   Date: 12/07/2005\n"
-  "#\n"
-  "#\n"
-  "#\n"
-
-  "DESCRIPTION         GpsDrive Format for Tracks\n"
-
-  "# FILE LAYOUT DEFINITIIONS:\n"
-  "#\n"
-  "FIELD_DELIMITER             WHITESPACE\n"
-  "RECORD_DELIMITER    NEWLINE\n"
-  "BADCHARS            ,'\"\n"
-
-  "SHORTLEN            20\n"
-  "SHORTWHITE              0\n"
-
-  "#\n"
-  "# INDIVIDUAL DATA FIELDS, IN ORDER OF APPEARANCE:\n"
-
-  "IFIELD      LAT_DECIMAL, \"\", \"%10.6f\"\n"
-  "IFIELD      LON_DECIMAL, \"\", \"%10.6f\"\n"
-  "IFIELD      ALT_METERS, \"\", \"%10.0f\"\n"
-  "# Reports are that this format stores in local time, not GMT as \n"
-  "# originally thought.\n"
-  "# IFIELD    GMT_TIME, \"\", \"%a %b %d %H:%M:%S %Y\"\n"
-  "IFIELD      LOCAL_TIME, \"\", \"%a %b %d %H:%M:%S %Y\"\n"
-  ;
-static char iblue747[] =
-  "# GPSBabel XCSV Style File https://www.gpsbabel.org/htmldoc-development/Styles.html\n"
-  "# Author: Christian Barmala http://www.barmala.de/\n"
-  "# License GNU Public License http://opensource.org/licenses/gpl-license.php\n"
-
-  "DESCRIPTION  Data Logger iBlue747 csv\n"
-  "EXTENSION csv\n"
-  "# full length csv with all options\n"
-
-  "# FILE LAYOUT DEFINITIIONS:\n"
-
-  "FIELD_DELIMITER COMMA\n"
-  "RECORD_DELIMITER NEWLINE\n"
-  "# BADCHARS COMMA\n"
-  "# SHORTLEN 16\n"
-  "# SHORTWHITE 0\n"
-  "# ENCODING UTF-8\n"
-  "DATATYPE TRACK\n"
-  "PROLOGUE INDEX,RCR,DATE,TIME,VALID,LATITUDE,N/S,LONGITUDE,E/W,HEIGHT,SPEED,HEADING,DSTA,DAGE,PDOP,HDOP,VDOP,NSAT (USED/VIEW),SAT INFO (SID-ELE-AZI-SNR),DISTANCE,\n"
-
-
-  "# INDIVIDUAL DATA FIELDS, IN ORDER OF APPEARANCE:\n"
-
-  "IFIELD INDEX,\"1\",\"%d\"            # INDEX\n"
-  "IFIELD CONSTANT,\"T\",\"%s\"        # RCR\n"
-  "IFIELD GMT_TIME,\"\",\"%Y/%m/%d\"        # DATE\n"
-  "IFIELD HMSG_TIME,\"\",\"%02d:%02d:%02d\"    # TIME\n"
-  "IFIELD GPS_FIX,\"\",\"%s\"        # VALID #  No fix, SPS, DGPS, PPS\n"
-  "IFIELD LAT_DECIMAL,\"\",\"%f\"        # LATITUDE\n"
-  "IFIELD LAT_DIR,\"\",\"%c\"            # N/S\n"
-  "IFIELD LON_DECIMAL,\"\",\"%f\"        # LONGITUDE\n"
-  "IFIELD LON_DIR,\"\",\"%c\"            # E/W\n"
-  "IFIELD ALT_METERS,\"\",\"%.0f\"        # HEIGHT\n"
-  "IFIELD PATH_SPEED_KPH,\"\",\"%.1f\"        # SPEED\n"
-  "IFIELD IGNORE,\"\",\"%s\"        # HEADING\n"
-  "IFIELD IGNORE,\"\",\"%s\"        # DSTA\n"
-  "IFIELD IGNORE,\"\",\"%s\"        # DAGE\n"
-  "IFIELD GPS_PDOP,\"\",\"%f\"            # PDOP\n"
-  "IFIELD GPS_HDOP,\"\",\"%f\"            # HDOP\n"
-  "IFIELD GPS_VDOP,\"\",\"%f\"            # VDOP\n"
-  "IFIELD GPS_SAT,\"\",\"%d(\"            # NSAT USED/VIEW\n"
-  "IFIELD IGNORE,\"\",\"%s\"        # SAT INFO\n"
-  "IFIELD PATH_DISTANCE_KM,\"\",\"%f\"        # DISTANCE\n"
-  ;
-static char iblue757[] =
-  "# GPSBabel XCSV Style File https://www.gpsbabel.org/htmldoc-development/Styles.html\n"
-  "# Author: iBlue747csv by Christian Barmala http://www.barmala.de/\n"
-  "#             edited by Anthony Vella to suit the iBlue757 csv format (date format changed)\n"
-  "# License GNU Public License http://opensource.org/licenses/gpl-license.php\n"
-
-  "DESCRIPTION  Data Logger iBlue757 csv\n"
-  "EXTENSION csv\n"
-  "# full length csv with all options\n"
-
-  "# FILE LAYOUT DEFINITIIONS:\n"
-
-  "FIELD_DELIMITER COMMA\n"
-  "RECORD_DELIMITER NEWLINE\n"
-  "# BADCHARS COMMA\n"
-  "# SHORTLEN 16\n"
-  "# SHORTWHITE 0\n"
-  "# ENCODING UTF-8\n"
-  "DATATYPE TRACK\n"
-  "PROLOGUE INDEX,RCR,DATE,TIME,VALID,LATITUDE,N/S,LONGITUDE,E/W,HEIGHT,SPEED,HEADING,DSTA,DAGE,PDOP,HDOP,VDOP,NSAT (USED/VIEW),SAT INFO (SID-ELE-AZI-SNR),DISTANCE,\n"
-
-
-  "# INDIVIDUAL DATA FIELDS, IN ORDER OF APPEARANCE:\n"
-
-  "IFIELD INDEX,\"1\",\"%d\"            # INDEX\n"
-  "IFIELD CONSTANT,\"T\",\"%s\"        # RCR\n"
-  "IFIELD GMT_TIME,\"\",\"%d/%m/%Y\"        # DATE\n"
-  "IFIELD HMSG_TIME,\"\",\"%02d:%02d:%02d\"    # TIME\n"
-  "IFIELD GPS_FIX,\"\",\"%s\"        # VALID #  No fix, SPS, DGPS, PPS\n"
-  "IFIELD LAT_DECIMAL,\"\",\"%f\"        # LATITUDE\n"
-  "IFIELD LAT_DIR,\"\",\"%c\"            # N/S\n"
-  "IFIELD LON_DECIMAL,\"\",\"%f\"        # LONGITUDE\n"
-  "IFIELD LON_DIR,\"\",\"%c\"            # E/W\n"
-  "IFIELD ALT_METERS,\"\",\"%.0f\"        # HEIGHT\n"
-  "IFIELD PATH_SPEED_KPH,\"\",\"%.1f\"        # SPEED\n"
-  "IFIELD IGNORE,\"\",\"%s\"        # HEADING\n"
-  "IFIELD IGNORE,\"\",\"%s\"        # DSTA\n"
-  "IFIELD IGNORE,\"\",\"%s\"        # DAGE\n"
-  "IFIELD GPS_PDOP,\"\",\"%f\"            # PDOP\n"
-  "IFIELD GPS_HDOP,\"\",\"%f\"            # HDOP\n"
-  "IFIELD GPS_VDOP,\"\",\"%f\"            # VDOP\n"
-  "IFIELD GPS_SAT,\"\",\"%d(\"            # NSAT USED/VIEW\n"
-  "IFIELD IGNORE,\"\",\"%s\"        # SAT INFO\n"
-  "IFIELD PATH_DISTANCE_KM,\"\",\"%f\"        # DISTANCE\n"
-  ;
-static char igo2008_poi[] =
-  "# gpsbabel XCSV style file\n"
-  "#\n"
-  "# Format: iGO2008 points of interest\n"
-  "# Author: Olaf Klein\n"
-  "#   Date: 09/05/2008\n"
-  "#\n"
-  "DESCRIPTION         iGO2008 points of interest (.upoi)\n"
-  "EXTENSION           upoi\n"
-  "DATATYPE            WAYPOINT\n"
-  "#\n"
-  "# FILE LAYOUT DEFINITIIONS:\n"
-  "#\n"
-  "FIELD_DELIMITER             PIPE\n"
-  "RECORD_DELIMITER    CRNEWLINE\n"
-  "BADCHARS            \"|\n"
-  "ENCODING            windows-1252\n"
-  "#\n"
-  "# INDIVIDUAL DATA FIELDS, IN ORDER OF APPEARANCE:\n"
-  "#\n"
-  "IFIELD      INDEX,\"1\",\"%d\"\n"
-  "IFIELD      DESCRIPTION, \"\", \"%s\"\n"
-  "IFIELD      SHORTNAME, \"\", \"%s\"\n"
-  "IFIELD      IGNORE, \"\", \"%s\"            # nothing\n"
-  "IFIELD      LAT_DECIMAL, \"\", \"%.6f\"\n"
-  "IFIELD      LON_DECIMAL, \"\", \"%.6f\"\n"
-  "IFIELD      IGNORE, \"\", \"%s\"            # Name of map\n"
-  "IFIELD      IGNORE, \"\", \"%s\"            # nothing\n"
-  "IFIELD      POSTAL_CODE, \"\", \"%s\"\n"
-  "IFIELD      CITY, \"\", \"%s\"\n"
-  "IFIELD      STREET_ADDR, \"\", \"%s\"               # Street without number\n"
-  "IFIELD      IGNORE, \"\", \"%s\"            # Street number\n"
-  "IFIELD      NOTES, \"\", \"%s\"\n"
-  "IFIELD      PHONE_NR, \"\", \"%s\"\n"
-  ;
-static char igoprimo_poi[] =
-  "# gpsbabel XCSV style file\n"
-  "#\n"
-  "# Format: iGo Primo points of interest\n"
-  "# Author: Scott Bradford\n"
-  "#   Date: 03/26/2016\n"
-  "#\n"
-  "DESCRIPTION         iGo Primo points of interest (.upoi)\n"
-  "EXTENSION           upoi\n"
-  "DATATYPE            WAYPOINT\n"
-  "#\n"
-  "# FILE LAYOUT DEFINITIONS:\n"
-  "#\n"
-  "FIELD_DELIMITER             PIPE\n"
-  "RECORD_DELIMITER    NEWLINE\n"
-  "BADCHARS            \"|\n"
-  "ENCODING            UTF-16LE\n"
-  "#\n"
-  "# INDIVIDUAL DATA FIELDS, IN ORDER OF APPEARANCE:\n"
-  "#\n"
-  "IFIELD      INDEX, \"1\", \"%d\"\n"
-  "IFIELD  CONSTANT, \"@Favourites\", \"%s\"   # always @Favourites?\n"
-  "IFIELD      SHORTNAME, \"\", \"%s\"\n"
-  "IFIELD      IGNORE, \"\", \"%s\"                            # always empty?\n"
-  "IFIELD      LAT_DECIMAL, \"\", \"%.6f\"\n"
-  "IFIELD      LON_DECIMAL, \"\", \"%.6f\"\n"
-  "IFIELD  CONSTANT, \"_u**\", \"%s\"                  # always _u**?\n"
-  "IFIELD      IGNORE, \"\", \"%s\"                            # always empty?\n"
-  "IFIELD  CONSTANT, \"_uva\", \"%s\"                  # always _uva?\n"
-  "IFIELD      IGNORE, \"\", \"%s\"                            # always empty?\n"
-  "IFIELD      POSTAL_CODE, \"\", \"%s\"\n"
-  "IFIELD      CITY, \"\", \"%s\"\n"
-  "IFIELD      STREET_ADDR, \"\", \"%s\"                       # should be street name (no number)\n"
-  "IFIELD      IGNORE, \"\", \"%s\"                            # should be street number\n"
-  "IFIELD      IGNORE, \"\", \"%s\"                            # always empty?\n"
-  "IFIELD      PHONE_NR, \"\", \"%s\"\n"
-  "IFIELD      IGNORE, \"\", \"%s\"                            # always empty?\n"
-  "IFIELD      IGNORE, \"\", \"%s\"                            # seems to be extra lat/lon values?\n"
-  ;
-static char kompass_tk[] =
-  "# gpsbabel XCSV style file\n"
-  "#\n"
-  "# Format: Kompass / Deutscher Alpenverein (DAV) Waypoints\n"
-  "# Author: Olaf Klein\n"
-  "#   Date: 01/10/2007\n"
-  "#\n"
-  "#\n"
-  "DESCRIPTION         Kompass (DAV) Track (.tk)\n"
-  "DATATYPE            TRACK\n"
-  "EXTENSION           wp\n"
-  "FIELD_DELIMITER             COMMA\n"
-  "RECORD_DELIMITER    NEWLINE\n"
-  "BADCHARS            ,\"\n"
-  "#\n"
-  "# INDIVIDUAL DATA FIELDS, IN ORDER OF APPEARANCE:\n"
-  "#\n"
-  "IFIELD      LAT_DECIMAL, \"\", \"%.7f\"\n"
-  "IFIELD      LON_DECIMAL, \"\", \"%.7f\"\n"
-  ;
-static char kompass_wp[] =
-  "# gpsbabel XCSV style file\n"
-  "#\n"
-  "# Format: Kompass / Deutscher Alpenverein (DAV) Waypoints\n"
-  "# Author: Olaf Klein\n"
-  "#   Date: 01/10/2007\n"
-  "#\n"
-  "#\n"
-  "DESCRIPTION         Kompass (DAV) Waypoints (.wp)\n"
-  "DATATYPE            WAYPOINT\n"
-  "EXTENSION           wp\n"
-  "ENCODING            UTF-8\n"
-  "FIELD_DELIMITER             SEMICOLON\n"
-  "RECORD_DELIMITER    CRNEWLINE\n"
-  "BADCHARS            ,\"\n"
-  "#\n"
-  "# INDIVIDUAL DATA FIELDS, IN ORDER OF APPEARANCE:\n"
-  "#\n"
-  "IFIELD      SHORTNAME, \"\", \"%s\"\n"
-  "IFIELD      LON_DECIMAL, \"\", \"%.7f\"\n"
-  "IFIELD      LAT_DECIMAL, \"\", \"%.7f\"\n"
-  "IFIELD      ALT_METERS, \"\", \"%.0f\"\n"
-  "IFIELD      LOCAL_TIME,\"\",\"%d.%m.%Y %H:%M:%S\"\n"
-  "IFIELD      CONSTANT, \"Icons\\Wegpunkt grün.bmp\", \"%s\"\n"
-  "IFIELD      IGNORE, \"\", \"%s\"\n"
-  "IFIELD  CONSTANT, \"1\", \"%s\"                     # unknown\n"
-  "IFIELD      DESCRIPTION, \"\", \"%s\"\n"
-  ;
-static char land_air_sea[] =
-  "# Format: GPS Tracking Key Pro text file\n"
-  "# Author: Tyler Ritchie\n"
-  "#   Date: 2011.02.04\n"
-
-  "DESCRIPTION GPS Tracking Key Pro text\n"
-  "EXTENSION txt\n"
-  "# ENCODING ISO-8859-1\n"
-
-  "DATUM WGS 84\n"
-  "DATATYPE TRACK\n"
-  "#File layout definitions\n"
-
-  "FIELD_DELIMITER COMMA\n"
-  "RECORD_DELIMITER NEWLINE\n"
-
-  "# Individual data fields in order of appearance\n"
-
-  "IFIELD LOCAL_TIME,\"\",\"%m-%d-%Y\"\n"
-  "IFIELD HMSG_TIME,\"\",\"%d:%d:%d\"\n"
-  "IFIELD LAT_HUMAN_READABLE,\"\",\"%c %d°%d'%f\\\"\"\n"
-  "IFIELD LON_HUMAN_READABLE,\"\",\"%c %d°%d'%f\\\"\"\n"
-  "IFIELD PATH_SPEED_MPH,\"\",\"%.1fmph\"\n"
-  "IFIELD IGNORE,\"\",\"%s\" #This is the bearing data\n"
-  "IFIELD ALT_FEET,\"\",\"%dft\"\n"
-  ;
-static char mainnav[] =
-  "#\n"
-  "#   Support for MainNav CSV format\n"
-  "#\n"
-  "#   Copyright (C) 2012 Robert Lipe, gpsbabel.org\n"
-  "#\n"
-  "#   This program is free software; you can redistribute it and/or modify\n"
-  "#   it under the terms of the GNU General Public License as published by\n"
-  "#   the Free Software Foundation; either version 2 of the License, or\n"
-  "#   (at your option) any later version.\n"
-  "#\n"
-  "#   This program is distributed in the hope that it will be useful,\n"
-  "#   but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
-  "#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n"
-  "#   GNU General Public License for more details.\n"
-  "#\n"
-  "#   You should have received a copy of the GNU General Public License\n"
-  "#   along with this program; if not, write to the Free Software\n"
-  "#   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.\n"
-  "#\n"
-  "# gpsbabel XCSV style file\n"
-  "# Format: Mainnav MG-950d data logger and possibly others\n"
-  "# Author: tsteven4\n"
-  "# Date: December 13, 2012\n"
-  "#\n"
-  "#\n"
-  "DESCRIPTION Mainnav\n"
-  "EXTENSION   nav\n"
-  "DATATYPE    TRACK\n"
-  "#\n"
-  "#\n"
-  "# FILE LAYOUT DEFINITIIONS:\n"
-  "#\n"
-  "FIELD_DELIMITER             COMMA\n"
-  "RECORD_DELIMITER    NEWLINE\n"
-  "BADCHARS    COMMA\n"
-
-  "#\n"
-  "# INDIVIDUAL DATA FIELDS, IN ORDER OF APPEARANCE:\n"
-  "#\n"
-  "IFIELD      LOCAL_TIME, \"\", \"%Y/%m/%d %H:%M:%S\"\n"
-  "IFIELD      LON_DECIMAL,\"\",\"%.9f\"\n"
-  "IFIELD      LON_DIR,\"\",\"%c\"\n"
-  "IFIELD      LAT_DECIMAL,\"\",\"%.9f\"\n"
-  "IFIELD      LAT_DIR,\"\",\"%c\"\n"
-  "IFIELD      ALT_FEET, \"\", \"%f\"\n"
-  "IFIELD      IGNORE, \"\", \"%s\"    # SPD?\n"
-  "IFIELD      IGNORE, \"\", \"%s\"    # PATH?\n"
-  "IFIELD      IGNORE, \"\", \"%s\"    # FILENAME?\n"
-  "IFIELD      IGNORE, \"\", \"%s\"    # MODE?\n"
-  "IFIELD      IGNORE, \"\", \"%s\"    # JOURNEY_INDEX?\n"
-  "IFIELD      IGNORE, \"\", \"%s\"    # ?\n"
-  ;
-static char mapconverter[] =
-  "# Format: Mapopolis.com Mapconverter\n"
-  "# Author: Gary Paulson\n"
-  "#   Date: 01/13/2003\n"
-  "# Requires unsupported mapconverter.exe from mapopolis.com.\n"
-  "#\n"
-  "# Modifications by Alex Mottram documented 6/30/2003\n"
-  "# Change %-40.40s on description output to %-.40s to stop padding.\n"
-  "# Add QUOTE as badchars, remove COMMA.\n"
-  "# Removed Mapconverter.exe's README information from style file.\n"
-  "# Changed OFIELD to IFIELD in case you ever want to read one of these things.\n"
-  "#\n"
-  "#\n"
-  "DESCRIPTION         Mapopolis.com Mapconverter CSV\n"
-  "EXTENSION           txt\n"
-
-  "# FILE LAYOUT DEFINITIIONS:\n"
-
-  "FIELD_DELIMITER   COMMASPACE\n"
-  "RECORD_DELIMITER  NEWLINE\n"
-  "BADCHARS          \",\n"
-
-  "# Map Info Record (header):\n"
-  "PROLOGUE M, \"Geocaches\", \"GPSBabel\", Geocaches, __FILE__\n"
-  "#\n"
-
-  "#\n"
-  "# INDIVIDUAL DATA FIELDS, IN ORDER OF APPEARANCE:\n"
-  "#\n"
-  "# L Records:\n"
-  "IFIELD  CONSTANT, \"L\", \"%s\"             # [L]ANDMARK\n"
-  "IFIELD  CONSTANT, \"Geocaches\", \"%s\"     # Category for Landmark Searches\n"
-  "IFIELD  DESCRIPTION, \"\", \"%-.40s\"       # Name\n"
-  "IFIELD  CONSTANT, \"1\", \"%s\"             # View at Zoom Level 1 (1-4)\n"
-  "IFIELD  LON_DECIMAL, \"\", \"%08.5f\"       # Longitude\n"
-  "IFIELD  LAT_DECIMAL, \"\", \"%08.5f\"       # Latitude\n"
-  ;
-static char motoactv[] =
-  "# gpsbabel XCSV style file\n"
-  "#\n"
-  "# Format: MOTOACTV CSV\n"
-  "# Author: Dan Brown\n"
-  "# Date: 07/21/2012\n"
-  "#\n"
-  "# example usage:\n"
-  "# gpsbabel -i xcsv,style=motoactv.style -f infile.csv -x transform,trk=wpt -o gtrnctr,course=0 -F outfile.tcx\n"
-  "# gpsbabel -i xcsv,style=motoactv.style -f infile.csv -x transform,trk=wpt -o gpx,garminextensions -F outfile.gpx\n"
-
-  "DESCRIPTION Motoactiv CSV\n"
-  "EXTENSION csv\n"
-
-  "ENCODING US-ASCII\n"
-  "FIELD_DELIMITER COMMA\n"
-  "RECORD_DELIMITER NEWLINE\n"
-  "FIELD_ENCLOSER DOUBLEQUOTE\n"
-
-  "PROLOGUE \"DISTANCE\",\"activity_id\",\"HEARTRATE\",\"SPEED\",\"STEPS_PER_MINUTE\",\"LATITUDE\",\"repetitions\",\"temperature\",\"INSTANT_TORQUE_CRANK\",\"timestamp_epoch\",\"ELEVATION\",\"POWER\",\"STRIDES\",\"wheel_torque\",\"CALORIEBURN\",\"LONGITUDE\",\"CADENCE\",\"heading\",\"STEP_RATE\"\n"
-
-  "# Data fields, in order of appearance\n"
-  "IFIELD PATH_DISTANCE_METERS,\"\",\"%.1f\" # used for writing files (not for reading)\n"
-  "IFIELD IGNORE,\"\",\"%s\" # activity id\n"
-  "IFIELD HEART_RATE,\"\",\"%d\"\n"
-  "IFIELD PATH_SPEED,\"\",\"%.1f\"\n"
-  "IFIELD IGNORE,\"\",\"%s\" # steps per minute\n"
-  "IFIELD LAT_DECIMAL,\"\",\"%.6f\"\n"
-  "IFIELD IGNORE,\"\",\"%s\" # repetitions\n"
-  "IFIELD TEMPERATURE,\"\",\"%.1f\"\n"
-  "IFIELD IGNORE,\"\",\"%s\" # instant torque crank\n"
-  "IFIELD TIMET_TIME_MS,\"\",\"%lld\"\n"
-  "IFIELD ALT_METERS,\"\",\"%.1f\"\n"
-  "IFIELD POWER,\"\",\"%.0f\"\n"
-  "IFIELD IGNORE,\"\",\"%s\" # strides\n"
-  "IFIELD IGNORE,\"\",\"%s\" # wheel_torque\n"
-  "IFIELD IGNORE,\"\",\"%s\" # calories\n"
-  "IFIELD LON_DECIMAL,\"\",\"%.6f\"\n"
-  "IFIELD CADENCE,\"\",\"%d\"\n"
-  "IFIELD PATH_COURSE,\"\",\"%.1f\"\n"
-  "IFIELD IGNORE,\"\",\"%s\" # step rate\n"
-  ;
-static char mxf[] =
-  "# gpsbabel XCSV style file\n"
-  "#\n"
-  "# Format: Ozi Explorer\n"
-  "# Author: Alex Mottram\n"
-  "#   Date: 12/09/2002\n"
-  "#\n"
-  "#\n"
-  "# As used in mxf.c\n"
-  "#\n"
-  "#\n"
-
-  "DESCRIPTION         MapTech Exchange Format\n"
-  "EXTENSION           mxf\n"
-
-  "#\n"
-  "# FILE LAYOUT DEFINITIIONS:\n"
-  "#\n"
-  "FIELD_DELIMITER             COMMASPACE\n"
-  "RECORD_DELIMITER    NEWLINE\n"
-  "BADCHARS            ,\"\n"
-
-  "#\n"
-  "# INDIVIDUAL DATA FIELDS, IN ORDER OF APPEARANCE:\n"
-  "#\n"
-  "IFIELD      LAT_DECIMAL, \"\", \"%08.5f\"\n"
-  "IFIELD      LON_DECIMAL, \"\", \"%08.5f\"\n"
-  "IFIELD      DESCRIPTION, \"\", \"\"%s\"\"\n"
-  "IFIELD      SHORTNAME, \"\", \"\"%s\"\"\n"
-  "IFIELD      IGNORE, \"\", \"%s\"\n"
-  "IFIELD      CONSTANT, \"ff0000\", \"%s\"    # COLOR\n"
-  "IFIELD      CONSTANT, \"47\", \"%s\"                # ICON\n"
-
-  "OFIELD      LAT_DECIMAL, \"\", \"%08.5f\"\n"
-  "OFIELD      LON_DECIMAL, \"\", \"%08.5f\"\n"
-  "OFIELD      DESCRIPTION, \"\", \"\"%s\"\"\n"
-  "OFIELD      SHORTNAME, \"\", \"\"%s\"\"\n"
-  "OFIELD      DESCRIPTION, \"\", \"\"%s\"\"\n"
-  "OFIELD      CONSTANT, \"ff0000\", \"%s\"    # COLOR\n"
-  "OFIELD      CONSTANT, \"47\", \"%s\"                # ICON\n"
-  ;
-static char navigonwpt[] =
-  "# gpsbabel XCSV style file\n"
-  "# Author: Tom Glaab\n"
-  "#\n"
-  "DESCRIPTION     Navigon Waypoints\n"
-  "SHORTLEN        8\n"
-  "#\n"
-  "#\n"
-  "# FILE LAYOUT DEFINITIIONS:\n"
-  "#\n"
-  "FIELD_DELIMITER         |\n"
-  "RECORD_DELIMITER        NEWLINE\n"
-  "BADCHARS                |\n"
-
-  "#\n"
-  "# INDIVIDUAL DATA FIELDS, IN ORDER OF APPEARANCE:\n"
-  "#\n"
-
-  "OFIELD  SHORTNAME, \"\",\"[%-.14s \"\n"
-  "OFIELD  CONSTANT, \"%s\",\"\"\n"
-  "OFIELD  CONSTANT, \"\",\"]\"\n"
-  "OFIELD  CONSTANT, \"%s\",\"[0][17]\"\n"
-  "OFIELD  CONSTANT, \"%s\",\"\"\n"
-  "OFIELD  CONSTANT, \"%s\",\"\"\n"
-  "OFIELD  LON_DECIMAL, \"\", \"%08.5f\"\n"
-  "OFIELD  LAT_DECIMAL, \"\", \"%08.5f\"\n"
-  "OFIELD  CONSTANT, \"%s\",\"\"\n"
-  "OFIELD  CONSTANT, \"%s\",\"\"\n"
-  "OFIELD  CONSTANT, \"%s\",\"\"\n"
-  "OFIELD  CONSTANT, \"%s\",\"\"\n"
-  "OFIELD  CONSTANT, \"%s\",\"\"\n"
-  "OFIELD  CONSTANT, \"%s\",\"\"\n"
-  "OFIELD  CONSTANT, \"%s\",\"\"\n"
-  "OFIELD  CONSTANT, \"%s\",\"\"\n"
-  "OFIELD  CONSTANT, \"%s\",\"\"\n"
-  "OFIELD  CONSTANT, \"%s\",\"\"\n"
-  "OFIELD  CONSTANT, \"%s\",\"\"\n"
-  "OFIELD  CONSTANT, \"%s\",\"\"\n"
-  "OFIELD  CONSTANT, \"%s\",\"\"\n"
-  "OFIELD  CONSTANT, \"%s\",\"\"\n"
-  "OFIELD  CONSTANT, \"%s\",\"49\"\n"
-  ;
-static char nima[] =
-  "# gpsbabel XCSV style file\n"
-  "#\n"
-  "# Format: NIMA/GNIS Geographic Names File\n"
-  "# Author: Alex Mottram\n"
-  "#   Date: 11/24/2002\n"
-  "#\n"
-
-  "DESCRIPTION  NIMA/GNIS Geographic Names File\n"
-
-  "#\n"
-  "# FILE LAYOUT DEFINITIIONS:\n"
-  "#\n"
-  "FIELD_DELIMITER             TAB\n"
-  "RECORD_DELIMITER    NEWLINE\n"
-  "BADCHARS            TAB\n"
-  "PROLOGUE    RC      UFI     UNI     DD_LAT  DD_LONG DMS_LAT DMS_LONG        UTM     JOG     FC      DSG     PC      CC1     ADM1    ADM2    DIM     CC2     NT      LC      SHORT_FORM      GENERIC SORT_NAME       FULL_NAME       FULL_NAME_ND    MODIFY_DATE\n"
-
-  "#\n"
-  "# INDIVIDUAL DATA FIELDS, IN ORDER OF APPEARANCE:\n"
-  "#\n"
-  "IFIELD      IGNORE, \"\", \"%s\"            # RC\n"
-  "IFIELD      IGNORE, \"\", \"%s\"            # UFI\n"
-  "IFIELD      IGNORE, \"\", \"%s\"            # UNI\n"
-  "IFIELD      LAT_DECIMAL, \"\", \"%f\"               # DD_LAT\n"
-  "IFIELD      LON_DECIMAL, \"\", \"%f\"               # DD_LON\n"
-  "IFIELD      IGNORE, \"\", \"%s\"            # DMS_LAT\n"
-  "IFIELD      IGNORE, \"\", \"%s\"            # DMS_LON\n"
-  "IFIELD      IGNORE, \"\", \"%s\"            # UTM\n"
-  "IFIELD      IGNORE, \"\", \"%s\"            # JOG\n"
-  "IFIELD      IGNORE, \"\", \"%s\"            # FC\n"
-  "IFIELD      IGNORE, \"\", \"%s\"            # DSG\n"
-  "IFIELD      IGNORE, \"\", \"%s\"            # PC\n"
-  "IFIELD      IGNORE, \"\", \"%s\"            # CC1\n"
-  "IFIELD      IGNORE, \"\", \"%s\"            # ADM1\n"
-  "IFIELD      IGNORE, \"\", \"%s\"            # ADM2\n"
-  "IFIELD      IGNORE, \"\", \"%s\"            # DIM\n"
-  "IFIELD      IGNORE, \"\", \"%s\"            # CC2\n"
-  "IFIELD      IGNORE, \"\", \"%s\"            # NT\n"
-  "IFIELD      IGNORE, \"\", \"%s\"            # LC\n"
-  "IFIELD      IGNORE, \"\", \"%s\"            # SHORT_FORM\n"
-  "IFIELD      IGNORE, \"\", \"%s\"            # GENERIC\n"
-  "IFIELD      SHORTNAME, \"\", \"%s\"         # SORT_NAME\n"
-  "IFIELD      IGNORE, \"\", \"%s\"            # FULL_NAME (unicoded!)\n"
-  "IFIELD      DESCRIPTION, \"\", \"%s\"               # FULL_NAME_ND\n"
-  "IFIELD      IGNORE, \"\", \"%s\"            # MODIFY_DATE\n"
-  ;
-static char openoffice[] =
-  "# gpsbabel XCSV style file\n"
-  "#\n"
-  "# Format: Tab delimited useful for OpenOffice, Ploticus etc.\n"
-  "# Author: Tobias Minich\n"
-  "#   Date: 07/18/2005\n"
-  "#\n"
-  "#\n"
-
-  "DESCRIPTION         Tab delimited fields useful for OpenOffice, Ploticus etc.\n"
-
-  "# FILE LAYOUT DEFINITIIONS:\n"
-  "#\n"
-  "FIELD_DELIMITER             TAB\n"
-  "RECORD_DELIMITER    NEWLINE\n"
-  "BADCHARS            TAB\n"
-
-  "#\n"
-  "# HEADER STUFF:\n"
-  "#\n"
-  "PROLOGUE    Index   Lat                     Lon                     Icon    Name    Description     Notes   URL     Link Text       Altitude (m)    Distance (km)   Speed (m/s)     Course (°)     Time    HDOP    VDOP    PDOP    Satellites      Fix\n"
-
-  "#\n"
-  "# INDIVIDUAL DATA FIELDS:\n"
-  "#\n"
-  "IFIELD      INDEX, \"\", \"%d\"\n"
-  "IFIELD      LAT_DECIMAL, \"\", \"%f\"\n"
-  "IFIELD      LAT_DIR, \"\", \"%c\"\n"
-  "IFIELD      LAT_HUMAN_READABLE, \"\", \"%d° %f' %c\"\n"
-  "IFIELD      LON_DECIMAL, \"\", \"%f\"\n"
-  "IFIELD      LON_DIR, \"\", \"%c\"\n"
-  "IFIELD      LON_HUMAN_READABLE, \"\", \"%d° %f' %c\"\n"
-  "IFIELD      ICON_DESCR, \"\", \"%s\"\n"
-  "IFIELD      SHORTNAME, \"\", \"%s\"\n"
-  "IFIELD      DESCRIPTION, \"\", \"%s\"\n"
-  "IFIELD      NOTES, \"\", \"%s\"\n"
-  "IFIELD      URL, \"\", \"%s\"               \n"
-  "IFIELD      URL_LINK_TEXT, \"\", \"%s\"\n"
-  "IFIELD      ALT_METERS, \"\", \"%f\"\n"
-  "IFIELD      PATH_DISTANCE_KM, \"\", \"%f\"\n"
-  "IFIELD      PATH_SPEED, \"\", \"%f\"\n"
-  "IFIELD      PATH_COURSE, \"\", \"%f\"\n"
-  "IFIELD      EXCEL_TIME, \"\", \"%f\"\n"
-  "IFIELD      GPS_HDOP, \"\", \"%f\"\n"
-  "IFIELD      GPS_VDOP, \"\", \"%f\"\n"
-  "IFIELD      GPS_PDOP, \"\", \"%f\"\n"
-  "IFIELD      GPS_SAT, \"\", \"%d\"\n"
-  "IFIELD      GPS_FIX, \"\", \"%s\"\n"
-  ;
-static char ricoh[] =
-  "DESCRIPTION Ricoh GPS Log File\n"
-  "EXTENSION log\n"
-  "DATATYPE TRACK\n"
-
-  "FIELD_DELIMITER COMMA\n"
-  "RECORD_DELIMITER NEWLINE\n"
-
-  "IFIELD LON_DECIMAL,\"\",\"%f\"\n"
-  "IFIELD LAT_DECIMAL,\"\",\"%f\"\n"
-  "IFIELD ALT_METERS,\"\",\"%f\"\n"
-  "IFIELD TRACK_NEW,\"\",\"%d\"\n"
-  "IFIELD GMT_TIME,\"\",\"%d-%m-%Y %H:%M:%S\"\n"
-
-  ;
-static char s_and_t[] =
-  "# gpsbabel XCSV style file\n"
-  "#\n"
-  "# Format: MS S&T 2002/2003\n"
-  "# Author: Alex Mottram\n"
-  "#   Date: 12/09/2002\n"
-  "#\n"
-  "#\n"
-  "# As requested by Noel Shrum on the gpsbabel-code mailing list.\n"
-  "# Name,Latitude,Longitude,Name 2,URL,Type\n"
-  "# GCCBF,44.479133,-85.56515,High Rollaway by rjlint,http://www.geocaching.com/seek/cache_details.aspx?ID=3263,Traditional Cache\n"
-  "# GC110D,44.6522,-85.492483,Brown Bridge Pond Peek-a-Boo Cache by Big Bird,http://www.geocaching.com/seek/cache_details.aspx?ID=4365,Traditional Cache\n"
-  "# GC171C,44.70605,-85.62265,The Michigan Frog by RealDcoy & LRB,http://www.geocaching.com/seek/cache_details.aspx?ID=5916,Traditional Cache\n"
-  "#\n"
-
-  "DESCRIPTION                 Microsoft Streets and Trips 2002-2007\n"
-  "EXTENSION               txt\n"
-
-
-  "#\n"
-  "# FILE LAYOUT DEFINITIIONS:\n"
-  "#\n"
-  "FIELD_DELIMITER             TAB\n"
-  "RECORD_DELIMITER    NEWLINE\n"
-  "BADCHARS            ,\"\n"
-
-  "PROLOGUE    Name    Latitude        Longitude       Description     URL     Type    Container       Diff    Terr\n"
-
-  "#\n"
-  "# INDIVIDUAL DATA FIELDS, IN ORDER OF APPEARANCE:\n"
-  "# NOTE: MS S&T ONLY IMPORTS DATA, IT DOESN'T EXPORT THIS ANYWHERE SO WE CAN\n"
-  "#       HAVE OUR WAY WITH THE FORMATTING. \n"
-  "#\n"
-  "IFIELD      SHORTNAME, \"\", \"%s\"         # Name\n"
-  "IFIELD      LAT_DECIMAL, \"\", \"%f\"               # Latitude\n"
-  "IFIELD      LON_DECIMAL, \"\", \"%f\"               # Longitude\n"
-  "IFIELD      DESCRIPTION, \"\", \"%s\"               # Name 2 (Big Description)\n"
-  "IFIELD      URL, \"\", \"%s\"                       # URL\n"
-  "IFIELD      GEOCACHE_TYPE, \"\", \"%s\"             # Geocache Type\n"
-  "IFIELD      GEOCACHE_CONTAINER, \"\", \"%s\"        # Geocache Type\n"
-  "IFIELD      GEOCACHE_DIFF, \"\", \"%3.1f\"  # Geocache Type\n"
-  "IFIELD      GEOCACHE_TERR, \"\", \"%3.1f\"  # Geocache Type\n"
-  ;
-static char saplus[] =
-  "# gpsbabel XCSV style file\n"
-  "#\n"
-  "# Format:\n"
-  "# Author: Jim Bensman\n"
-  "#   Date: 02/22/04\n"
-  "#\n"
-
-  "DESCRIPTION             DeLorme Street Atlas Plus\n"
-
-  "#\n"
-  "# FILE LAYOUT DEFINITIIONS:\n"
-  "#\n"
-  "FIELD_DELIMITER         COMMA\n"
-  "RECORD_DELIMITER        NEWLINE\n"
-  "BADCHARS                ,\"\n"
-
-  "PROLOGUE        Name 2,Name,Latitude,Longitude,URL,Type\n"
-
-  "#\n"
-  "# INDIVIDUAL DATA FIELDS, IN ORDER OF APPEARANCE:\n"
-  "#\n"
-  "IFIELD  DESCRIPTION, \"\", \"%s\"           # Name 2 (Big Description)\n"
-  "IFIELD  SHORTNAME, \"\", \"%s\"             # Name\n"
-  "IFIELD  LAT_DECIMAL, \"\", \"%f\"           # Latitude\n"
-  "IFIELD  LON_DECIMAL, \"\", \"%f\"           # Longitude\n"
-  "IFIELD  URL, \"\", \"%s\"                   # URL\n"
-  "IFIELD  IGNORE, \"\", \"\"                  # Holder for Geocache Type\n"
-
-  ;
-static char tabsep[] =
-  "# gpsbabel XCSV style file\n"
-  "#\n"
-  "# Format: Dumps all fields in a traditional Unix tab separated style\n"
-  "#\n"
-  "# The order of the fields (with the exception of LAT_DIR/LON_DIR) was\n"
-  "# the same as documented in README.style when this format was created.\n"
-  "# LAT_DIR/LON_DIR were undocumented, so I stuck them at the end of the\n"
-  "# other lat/lon fields.\n"
-  "#\n"
-  "# However, please add any new gpsbabel fields to the end (to avoid\n"
-  "# upsetting existing applications) regardless of where they land in\n"
-  "# the README.style documentation.\n"
-  "#\n"
-
-  "DESCRIPTION         All database fields on one tab-separated line\n"
-
-  "# FILE LAYOUT DEFINITIIONS:\n"
-  "#\n"
-  "FIELD_DELIMITER             TAB\n"
-  "RECORD_DELIMITER    NEWLINE\n"
-  "BADCHARS            TAB\n"
-  "FORMAT_TYPE         INTERNAL\n"
-
-  "#\n"
-  "# INDIVIDUAL DATA FIELDS:\n"
-  "#\n"
-  "IFIELD      INDEX, \"\", \"%d\"\n"
-  "IFIELD      SHORTNAME, \"\", \"%s\"\n"
-  "IFIELD      DESCRIPTION, \"\", \"%s\"\n"
-  "IFIELD      NOTES, \"\", \"%s\"\n"
-  "IFIELD      URL, \"\", \"%s\"\n"
-  "IFIELD      URL_LINK_TEXT, \"\", \"%s\"\n"
-  "IFIELD      ICON_DESCR, \"\", \"%s\"\n"
-  "IFIELD      LAT_DECIMAL, \"\", \"%f\"\n"
-  "IFIELD      LON_DECIMAL, \"\", \"%f\"\n"
-  "IFIELD      LAT_INT32DEG, \"\", \"%ld\"\n"
-  "IFIELD      LON_INT32DEG, \"\", \"%ld\"\n"
-  "IFIELD      LAT_DECIMALDIR, \"\", \"%f%c\"\n"
-  "IFIELD      LON_DECIMALDIR, \"\", \"%f%c\"\n"
-  "IFIELD      LAT_DIRDECIMAL, \"\", \"%c%f\"\n"
-  "IFIELD      LON_DIRDECIMAL, \"\", \"%c%f\"\n"
-  "IFIELD      LAT_DIR, \"\", \"%c\"\n"
-  "IFIELD      LON_DIR, \"\", \"%c\"\n"
-  "IFIELD      ALT_FEET, \"\", \"%fF\"\n"
-  "IFIELD      ALT_METERS, \"\", \"%fM\"\n"
-  "IFIELD      EXCEL_TIME, \"\", \"%f\"\n"
-  "IFIELD      TIMET_TIME, \"\", \"%lld\"\n"
-  "IFIELD  GEOCACHE_DIFF,\"\",\"%3.1f\"\n"
-  "IFIELD  GEOCACHE_TERR,\"\",\"%3.1f\"\n"
-  "IFIELD  GEOCACHE_CONTAINER,\"\",\"%s\"\n"
-  "IFIELD  GEOCACHE_TYPE,\"\",\"%s\"\n"
-  "IFIELD  PATH_DISTANCE_MILES,\"\",\"%f\"\n"
-  "IFIELD  PATH_DISTANCE_KM, \"\", \"%f\"\n"
-  "IFIELD  GEOCACHE_PLACER,\"\",\"%s\"\n"
-  "IFIELD  YYYYMMDD_TIME,\"\",\"%ld\"\n"
-  "IFIELD      GEOCACHE_HINT, \"\", \"%s\"\n"
-  "IFIELD      GEOCACHE_LAST_FOUND, \"\", \"%d\"\n"
-  ;
-static char tomtom_asc[] =
-  "# gpsbabel XCSV style file\n"
-  "#\n"
-  "# Format: TomTom Navigator Places of Interest\n"
-  "# Author: Olaf Klein\n"
-  "#   Date: 04/17/2007\n"
-  "#\n"
-  "DESCRIPTION         TomTom POI file (.asc)\n"
-  "EXTENSION           asc\n"
-  "DATATYPE            WAYPOINT\n"
-  "#\n"
-  "# FILE LAYOUT DEFINITIIONS:\n"
-  "#\n"
-  "FIELD_DELIMITER             COMMA\n"
-  "RECORD_DELIMITER    CRNEWLINE\n"
-  "BADCHARS            ,\"\n"
-  "ENCODING            windows-1252\n"
-  "#\n"
-  "PROLOGUE     TomTom Navigator Places of Interest\n"
-  "PROLOGUE     GPSBabel-__VERSION__ ASCII Export\n"
-  "PROLOGUE      Points\n"
-  "PROLOGUE     Created at: __DATE_AND_TIME__\n"
-  "# #\n"
-  "# INDIVIDUAL DATA FIELDS, IN ORDER OF APPEARANCE:\n"
-  "#\n"
-  "IFIELD      LON_DECIMAL, \"\", \"%.6f\"\n"
-  "IFIELD      LAT_DECIMAL, \"\", \"%.6f\"\n"
-  "IFIELD      SHORTNAME, \"\", \"\"%s\"\"\n"
-  ;
-static char tomtom_itn[] =
-  "# gpsbabel XCSV style file\n"
-  "#\n"
-  "# Format: TomTom Navigator Itineraries (Routes)\n"
-  "# Author: Olaf Klein\n"
-  "#   Date: 04/17/2007\n"
-  "#\n"
-  "DESCRIPTION         TomTom Itineraries (.itn)\n"
-  "EXTENSION           itn\n"
-  "DATATYPE            ROUTE\n"
-  "#\n"
-  "# FILE LAYOUT DEFINITIIONS:\n"
-  "#\n"
-  "FIELD_DELIMITER             PIPE\n"
-  "RECORD_DELIMITER    CRNEWLINE\n"
-  "BADCHARS            ,|\n"
-  "ENCODING            windows-1252\n"
-  "#\n"
-  "# INDIVIDUAL DATA FIELDS, IN ORDER OF APPEARANCE:\n"
-  "#\n"
-  "IFIELD      LON_10E5, \"\", \"%.0f\"\n"
-  "IFIELD      LAT_10E5, \"\", \"%.0f\"\n"
-  "IFIELD      SHORTNAME, \"\", \"%s\"\n"
-  "IFIELD      CONSTANT, \"0\", \"%s\"\n"
-  ;
-static char tomtom_itn_places[] =
-  "# gpsbabel XCSV style file\n"
-  "#\n"
-  "# Format: TomTom Navigator Itineraries (Routes)\n"
-  "# Author: Olaf Klein\n"
-  "#   Date: 04/17/2007\n"
-  "#\n"
-  "DESCRIPTION         TomTom Places Itineraries (.itn)\n"
-  "EXTENSION           itn\n"
-  "DATATYPE            ROUTE\n"
-  "#\n"
-  "# FILE LAYOUT DEFINITIIONS:\n"
-  "#\n"
-  "FIELD_DELIMITER             PIPE\n"
-  "RECORD_DELIMITER    CRNEWLINE\n"
-  "BADCHARS            ,|\n"
-  "ENCODING            windows-1252\n"
-  "#\n"
-  "# INDIVIDUAL DATA FIELDS, IN ORDER OF APPEARANCE:\n"
-  "#\n"
-  "IFIELD      LON_10E5, \"\", \"%.f\"\n"
-  "IFIELD      LAT_10E5, \"\", \"%.f\"\n"
-  "IFIELD      SHORTNAME, \"\", \"%s\"\n"
-  "IFIELD      CONSTANT, \"2\", \"%s\"\n"
-  ;
-const QVector<style_vecs_t> style_list = {{ "tomtom_itn_places", tomtom_itn_places }, { "tomtom_itn", tomtom_itn }, { "tomtom_asc", tomtom_asc }, { "tabsep", tabsep }, { "saplus", saplus }, { "s_and_t", s_and_t }, { "ricoh", ricoh }, { "openoffice", openoffice }, { "nima", nima }, { "navigonwpt", navigonwpt }, { "mxf", mxf }, { "motoactv", motoactv }, { "mapconverter", mapconverter }, { "mainnav", mainnav }, { "land_air_sea", land_air_sea }, { "kompass_wp", kompass_wp }, { "kompass_tk", kompass_tk }, { "igoprimo_poi", igoprimo_poi }, { "igo2008_poi", igo2008_poi }, { "iblue757", iblue757 }, { "iblue747", iblue747 }, { "gpsdrivetrack", gpsdrivetrack }, { "gpsdrive", gpsdrive }, { "geonet", geonet }, { "garmin_poi", garmin_poi }, { "garmin_g1000", garmin_g1000 }, { "garmin301", garmin301 }, { "fugawi", fugawi }, { "flysight", flysight }, { "dna", dna }, { "custom", custom }, { "cup", cup }, { "csv", csv }, { "cambridge", cambridge }, { "arc", arc }};
-#else /* CSVFMTS_ENABLED */
-const QVector<style_vecs_t> style_list;
-#endif /* CSVFMTS_ENABLED */
diff --git a/mkstyle.sh b/mkstyle.sh
deleted file mode 100755 (executable)
index 68509f9..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-#!/bin/sh
-
-echo "/* This file is machine-generated from the contents of style/ */"
-echo "/* by mkstyle.sh.   Editing it by hand is an exceedingly bad idea. */"
-echo
-
-# set the locale for sorting so that the collate order doesn't depend
-# on the users environment.
-LC_COLLATE=C
-export LC_COLLATE
-
-# require gnu sed even though we aren't using gnu extensions.
-# this avoids portability issues with other seds.
-if gsed v /dev/null 1>/dev/null 2>&1; then
-  SED=gsed
-elif sed v /dev/null 1>/dev/null 2>&1; then
-  # sed is gnu sed
-  SED=sed
-elif [ "$(uname -s)" = "Darwin" ]; then
-  # BSD sed is usually fine, but if a style file is encoded in ISO-8859 then it
-  # can echo a warning "sed: RE error: illegal byte sequence" to stderr and the
-  # output can be corrupted, while return exit status 0.  Since we no longer use
-  # this encoding for style files allow Darwin's sed.
-  SED=/usr/bin/sed
-elif [ "$(uname -s)" = "FreeBSD" ]; then
-  # BSD sed is fine
-  SED=/usr/bin/sed
-else
-  echo "Error: can't find gnu sed" 1>&2
-  exit 1
-fi
-
-echo "#include <QVector>"
-echo "#include \"defs.h\""
-echo "#if CSVFMTS_ENABLED"
-for i in "$(dirname "$0")"/style/*.style
-do
-  A=$(basename "$i" .style)
-  if [ "x${ALIST}" = "x" ]; then
-    ALIST="{ \"$A\", $A }"
-  else
-    ALIST="{ \"$A\", $A }, $ALIST"
-  fi
-  echo "static char $A[] ="
-  $SED 's/\\/\\\\/;s/"/\\"/g;s/^\(.\)/"\1/g;s/\(.\)$/\1\\n"/g;s/^\(.\)/  \1/' "$i"
-  echo "  ;"
-done
-echo "const QVector<style_vecs_t> style_list = {$ALIST};"
-echo "#else /* CSVFMTS_ENABLED */"
-echo "const QVector<style_vecs_t> style_list;"
-echo "#endif /* CSVFMTS_ENABLED */"
-
index b90556f7dd166f90e31ab57714c9c219a4b89de1..5ab523c69bd7c0da2d17fcfeac5983b381297a41 100644 (file)
@@ -34,7 +34,7 @@ IFIELD        ICON_DESCR, "", "%s"
 IFIELD SHORTNAME, "", "%s"
 IFIELD DESCRIPTION, "", "%s"
 IFIELD NOTES, "", "%s"
-IFIELD URL, "", "%s"           
+IFIELD URL, "", "%s"
 IFIELD URL_LINK_TEXT, "", "%s"
 IFIELD ALT_METERS, "", "%fM"
 IFIELD ALT_FEET, "", "%fF"
index 1a30052a1bcd082563324c87824bb823f0829092..104eb42ccce8ee1658e8e22d5d445f8e6caadbf2 100644 (file)
@@ -24,7 +24,7 @@ SHORTWHITE              0
 IFIELD LAT_DECIMAL, "", "%10.6f"
 IFIELD LON_DECIMAL, "", "%10.6f"
 IFIELD ALT_METERS, "", "%10.0f"
-# Reports are that this format stores in local time, not GMT as 
+# Reports are that this format stores in local time, not GMT as
 # originally thought.
 # IFIELD       GMT_TIME, "", "%a %b %d %H:%M:%S %Y"
 IFIELD LOCAL_TIME, "", "%a %b %d %H:%M:%S %Y"
index ee2d30934e77b08b9d73b91162c9ad2d5524c025..e712c2ae8c63a5366796b3494f3dc8400a00bd3b 100644 (file)
@@ -33,7 +33,7 @@ IFIELD        ICON_DESCR, "", "%s"
 IFIELD SHORTNAME, "", "%s"
 IFIELD DESCRIPTION, "", "%s"
 IFIELD NOTES, "", "%s"
-IFIELD URL, "", "%s"           
+IFIELD URL, "", "%s"
 IFIELD URL_LINK_TEXT, "", "%s"
 IFIELD ALT_METERS, "", "%f"
 IFIELD PATH_DISTANCE_KM, "", "%f"
index ce0610cd503112712da8b36d70b22bcd75262ee4..649003385e3a21bbf1866da7bf81272195914815 100644 (file)
@@ -28,7 +28,7 @@ PROLOGUE      Name    Latitude        Longitude       Description     URL     Type    Container       Diff    Terr
 #
 # INDIVIDUAL DATA FIELDS, IN ORDER OF APPEARANCE:
 # NOTE: MS S&T ONLY IMPORTS DATA, IT DOESN'T EXPORT THIS ANYWHERE SO WE CAN
-#       HAVE OUR WAY WITH THE FORMATTING. 
+#       HAVE OUR WAY WITH THE FORMATTING.
 #
 IFIELD SHORTNAME, "", "%s"             # Name
 IFIELD LAT_DECIMAL, "", "%f"           # Latitude
index 235f55518686c824e32c95517b7c0911598b7291..05ad8f5c13391aa572bc8d331e5ca650201fe8ca 100755 (executable)
@@ -13,12 +13,6 @@ if [ -e /etc/os-release ]; then
        cat /etc/os-release
 fi
 git --no-pager log -n 1
-# the timestamps from a svn co are unpredicatble.
-# this can cause problems if targets are checked into svn.
-# some of our targets are part of the svn repository to allow a
-# minimal set of build tools to be used.
-# touch these targets to make sure they aren't considered out of date.
-touch internal_styles.cc
 
 # build and test keeping output within the pwd.
 export GBTEMP=$(mktemp -d -p $(pwd) GBTEMPXXXX)
diff --git a/vecs.cc b/vecs.cc
index 4c5b1485cfdbdc17b80920242464c91d315f6b16..438f534cec5ff69ddb3cbecb3b41960135923f9e 100644 (file)
--- a/vecs.cc
+++ b/vecs.cc
@@ -20,6 +20,9 @@
  */
 
 #include <QByteArray>           // for QByteArray
+#include <QDir>                 // for QDir, QDir::Files, QDir::Name
+#include <QFileInfo>            // for QFileInfo
+#include <QFileInfoList>        // for QFileInfoList
 #include <QString>              // for QString
 #include <QStringList>          // for QStringList
 #include <QVector>              // for QVector<>::iterator, QVector
@@ -37,8 +40,8 @@
 #include "gbversion.h"          // for WEB_DOC_DIR
 #include "inifile.h"            // for inifile_readstr
 #include "legacyformat.h"
-#include "src/core/logging.h"   // for Warning
-#include "xcsv.h"               // for xcsv_setup_internal_style, XcsvStyle, xcsv_read_internal_style
+#include "src/core/logging.h"   // for Warning, FatalMsg
+#include "xcsv.h"               // for xcsv_setup_internal_style, XcsvStyle, xcsv_read_style
 
 
 #define MYNAME "vecs"
@@ -74,6 +77,7 @@ void Vecs::init_vecs()
       }
     }
   }
+  style_list = create_style_vec();
 }
 
 int Vecs::is_integer(const char* c)
@@ -96,6 +100,8 @@ void Vecs::exit_vecs()
       }
     }
   }
+  style_list.clear();
+  style_list.squeeze();
 }
 
 void Vecs::assign_option(const QString& module, arglist_t* arg, const char* val)
@@ -283,7 +289,7 @@ Format* Vecs::find_vec(const QString& vecname)
    * Didn't find it in the table of "real" file types, so plan B
    * is to search the list of xcsv styles.
    */
-  for (const auto& svec : style_list) {
+  for (const auto& svec : qAsConst(style_list)) {
     if (svecname.compare(svec.name,  Qt::CaseInsensitive) != 0) {
       continue;
     }
@@ -318,7 +324,7 @@ Format* Vecs::find_vec(const QString& vecname)
       disp_vec_options(svec.name, xcsv_args);
     }
 #if CSVFMTS_ENABLED
-    xcsv_fmt.xcsv_setup_internal_style(svec.style_buf);
+    xcsv_fmt.xcsv_setup_internal_style(svec.style_filename);
 #endif // CSVFMTS_ENABLED
 
     vec_list[0].vec->set_name(svec.name);      /* needed for session information */
@@ -363,6 +369,32 @@ QString Vecs::get_option(const QStringList& options, const char* argname)
   return rval;
 }
 
+QVector<Vecs::style_vec_t> Vecs::create_style_vec()
+{
+  QString styledir(":/style");
+  QDir dir(styledir);
+  if (!dir.isReadable()) {
+    fatal(FatalMsg() << "style directory" << QFileInfo(styledir).absoluteFilePath() << "not readable.");
+  }
+
+  dir.setNameFilters(QStringList("*.style"));
+  dir.setFilter(QDir::Files);
+  dir.setSorting(QDir::Name);
+  QFileInfoList fileinfolist = dir.entryInfoList();
+  QVector<style_vec_t> slist;
+  for (const auto& fileinfo : fileinfolist) {
+    if (!fileinfo.isReadable()) {
+      fatal(FatalMsg() << "Cannot open style file" << fileinfo.absoluteFilePath() << ".");
+    }
+
+    style_vec_t entry;
+    entry.name = fileinfo.baseName();
+    entry.style_filename = fileinfo.filePath();
+    slist.append(entry);
+  }
+  return slist;
+}
+
 /*
  * Gather information relevant to serialization from the
  * vecs and style lists.  Sort and return the information.
@@ -408,7 +440,7 @@ QVector<Vecs::vecinfo_t> Vecs::sort_and_unify_vecs() const
 
   /* Gather the relevant info for the style based formats. */
   for (const auto& svec : style_list) {
-    XcsvStyle style = XcsvStyle::xcsv_read_internal_style(svec.style_buf);
+    XcsvStyle style = XcsvStyle::xcsv_read_style(svec.style_filename);
     vecinfo_t info;
     info.name = svec.name;
     info.desc = style.description;
diff --git a/vecs.h b/vecs.h
index f454ea2dab1abe274a8892ff48d158b504e10164..4fd6a3d55a5eb18c2f94b50399811b4b0677939e 100644 (file)
--- a/vecs.h
+++ b/vecs.h
@@ -187,6 +187,12 @@ private:
     QVector<arginfo_t> arginfo;
   };
 
+  struct style_vec_t {
+    QString name;
+    QString style_filename;
+  };
+
+
 public:
   void init_vecs();
   void exit_vecs();
@@ -204,6 +210,7 @@ public:
 
 private:
   static int is_integer(const char* c);
+  static QVector<style_vec_t> create_style_vec();
   QVector<vecinfo_t> sort_and_unify_vecs() const;
   static void disp_v1(ff_type t);
   static void disp_v2(const vecinfo_t& v);
@@ -212,6 +219,7 @@ private:
   static bool validate_vec(const vecs_t& vec);
 
 private:
+  QVector<style_vec_t> style_list;
   /*
    * Having these LegacyFormat instances be non-static data members
    * prevents the static initialization order fiasco because
diff --git a/xcsv.cc b/xcsv.cc
index c488de406e85a0d118f47abd9135a66fbc9db2ed..f161c7952ec5bf165e6aef5e7662c61d67264661 100644 (file)
--- a/xcsv.cc
+++ b/xcsv.cc
@@ -1792,25 +1792,8 @@ XcsvStyle::xcsv_parse_style_line(XcsvStyle* style, QString line)
   }
 }
 
-
-/*
- * A wrapper for xcsv_parse_style_line that reads until it hits
- * a terminating null.   Makes multiple calls to that function so
- * that "ignore to end of line" comments work right.
- */
-XcsvStyle
-XcsvStyle::xcsv_parse_style_buff(const char* sbuff)
-{
-  XcsvStyle style;
-  const QStringList lines = QString(sbuff).split('\n');
-  for (const auto& line : lines) {
-    xcsv_parse_style_line(&style, line);
-  }
-  return style;
-}
-
 XcsvStyle
-XcsvStyle::xcsv_read_style(const char* fname)
+XcsvStyle::xcsv_read_style(const QString& fname)
 {
   XcsvStyle style;
 
@@ -1830,28 +1813,10 @@ XcsvStyle::xcsv_read_style(const char* fname)
   return style;
 }
 
-/*
- * Passed a pointer to an internal buffer that would be identical
- * to the series of bytes that would be in a style file, we set up
- * the xcsv parser and make it ready for general use.
- */
-XcsvStyle
-XcsvStyle::xcsv_read_internal_style(const char* style_buf)
-{
-  XcsvStyle style = xcsv_parse_style_buff(style_buf);
-
-  /* if we have no output fields, use input fields as output fields */
-  if (style.ofields.isEmpty()) {
-    style.ofields = style.ifields;
-  }
-
-  return style;
-}
-
 void
-XcsvFormat::xcsv_setup_internal_style(const char* style_buf)
+XcsvFormat::xcsv_setup_internal_style(const QString& style_filename)
 {
-  intstylebuf = style_buf;
+  intstylefile = style_filename;
 }
 
 void
@@ -1861,8 +1826,8 @@ XcsvFormat::rd_init(const QString& fname)
    * if we don't have an internal style defined, we need to
    * read it from a user-supplied style file, or die trying.
    */
-  if (intstylebuf != nullptr) {
-    xcsv_style = new XcsvStyle(XcsvStyle::xcsv_read_internal_style(intstylebuf));
+  if (!intstylefile.isEmpty()) {
+    xcsv_style = new XcsvStyle(XcsvStyle::xcsv_read_style(intstylefile));
   } else {
     if (!styleopt) {
       fatal(MYNAME ": XCSV input style not declared.  Use ... -i xcsv,style=path/to/file.style\n");
@@ -1918,8 +1883,8 @@ XcsvFormat::wr_init(const QString& fname)
    * if we don't have an internal style defined, we need to
    * read it from a user-supplied style file, or die trying.
    */
-  if (intstylebuf != nullptr) {
-    xcsv_style = new XcsvStyle(XcsvStyle::xcsv_read_internal_style(intstylebuf));
+  if (!intstylefile.isEmpty()) {
+    xcsv_style = new XcsvStyle(XcsvStyle::xcsv_read_style(intstylefile));
   } else {
     if (!styleopt) {
       fatal(MYNAME ": XCSV output style not declared.  Use ... -o xcsv,style=path/to/file.style\n");
diff --git a/xcsv.h b/xcsv.h
index 4987b42651d5b77c2d367c30e23fabaf41cf582c..32cd13c668243b121ce2951f349acd436395febe 100644 (file)
--- a/xcsv.h
+++ b/xcsv.h
@@ -175,8 +175,7 @@ public:
   /* Member Functions */
 
   static QString xcsv_get_char_from_constant_table(const QString& key);
-  static XcsvStyle xcsv_read_internal_style(const char* style_buf);
-  static XcsvStyle xcsv_read_style(const char* fname);
+  static XcsvStyle xcsv_read_style(const QString& fname);
 
   /* Data Members */
 
@@ -251,7 +250,6 @@ private:
   static void xcsv_ifield_add(XcsvStyle* style, const QString& qkey, const QString& qval, const QString& qpfc);
   static void xcsv_ofield_add(XcsvStyle* style, const QString& qkey, const QString& qval, const QString& qpfc, unsigned int options);
   static void xcsv_parse_style_line(XcsvStyle* style, QString line);
-  static XcsvStyle xcsv_parse_style_buff(const char* sbuff);
 
   /* Data Members */
 
@@ -300,7 +298,7 @@ public:
   void wr_position(Waypoint* wpt) override;
   void wr_position_deinit() override;
 
-  void xcsv_setup_internal_style(const char* style_buf);
+  void xcsv_setup_internal_style(const QString& style_filename);
 
 private:
   /* Types */
@@ -405,7 +403,7 @@ private:
   char* xcsv_urlbase = nullptr;
   char* opt_datum = nullptr;
 
-  const char* intstylebuf = nullptr;
+  QString intstylefile;
 
   QVector<arglist_t> xcsv_args = {
     {